pysqlx-engine

PySQLXEngine, a minimalist asynchronous SQL engine.

Downloads
6.7K
Stars
11
Committers
4

Bot releases are hidden (Show)

pysqlx-engine - v0.2.3

Published by carlos-rian almost 2 years ago

Fixed bug: query without column or empty.

Generate column with prefix: col_{index}

SQLite and MySQL
If the name is a number, for example:

SELECT 1.3, 2.2

Columns: col_1_3 and col_2_2

PostgreSQL and Microsoft SQL Server
If the name is empty, for example:

SELECT 1, 2

Columns: col_0 and col_1

This allows Pydantic or dict not to remove values with equal keys.

pysqlx-engine - v0.2.2

Published by carlos-rian almost 2 years ago

  1. Write a new core using Rust + PyO3 + PyO3-asyncio.

  2. Add new methods:

    • .is_healthy() check if the connection is healthy.
    • .requires_isolation_first() this is used to determine if the connection should be isolated before executing a sql.
    • .raw_cmd() run a command in the database, for queries that can't be run using prepared statements.
    • .query_as_dict() to return actual records (for example, using SELECT).
    • .query_first_as_dict() to return actual records (for example, using SELECT).
    • .set_isolation_level() the isolation level is set before the transaction is started. Is used to separate the transaction per level.
    • .begin() starts a transaction.
    • .commit() commits a transaction.
    • .rollback() rollbacks a transaction.
    • .start_transaction() starts a transaction with BEGIN/BEGIN TRANSACTION. By default, does not set the isolation level. But is possible to set the isolation level using the parameter isolation_level.
  3. Remove the argument as_dict from the method .query() and .query_first(). Now, the method .query_as_dict() and .query_first_as_dict() should be used.

  4. Add the argument parameters to the methods .query* and .execute. This is used to pass the parameters to the query.

  5. Change documentation: add new examples.

  6. Write tests for the new core and the new methods.