Firebirdsql wrapper inspired by subprocess.run
Project description
firebirdsql-run
Firebirdsql wrapper inspired by subprocess.run
Installation
pip install firebirdsql-run
Examples
- Execute a transaction
result = execute(query="SELECT * FROM table", db="database")
print(result.data) # Output: List of dictionaries containing the query results
- Execute a transaction with custom parameters and an existing connection
conn = connection(db="/path/to/database.fdb")
result = execute("INSERT INTO customers (name, age) VALUES (?, ?)", params=("John", 25), use_conn=conn)
print(result.returncode) # Output: 0 (success)
conn.close()
Representation of a completed transaction
- Table
maker | model | type |
---|---|---|
B | 1121 | PC |
A | 1232 | PC |
- Success example
CompletedTransaction(
host="127.0.0.1",
db="database",
user="TWUSER",
returncode=0,
error="",
query="SELECT * FROM table",
params=(),
data=[
{"maker": "B", "model": 1121, "type": "PC"},
{"maker": "A", "model": 1232, "type": "PC"},
],
)
- Error example
CompletedTransaction(
host="127.0.0.1",
db="database",
user="TWUSER",
returncode=1,
error="Dynamic SQL Error\nSQL error code = -204\nTable unknown\ntable\nAt line 1, column 15\n",
query="SELECT * FROM table",
params=(),
data=[],
)
Env variables
FIREBIRD_KEY=
The FIREBIRD_KEY
environment variable can be overridden with the function argument passwd
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for firebirdsql_run-1.0.8a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22f85741519fc2c7ce3d7e6e6b1eacb2b71fa4985a713bdddd865aff8aa79a95 |
|
MD5 | 7a345dcd14c39d90e40fb303a3e71561 |
|
BLAKE2b-256 | b01a0c50bde0cab69816e004bd5f49ee8a741b6d896419c9abc67ec782b8c3b3 |