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
File details
Details for the file firebirdsql_run-1.0.8a0.tar.gz
.
File metadata
- Download URL: firebirdsql_run-1.0.8a0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35f08ac5e3213cd5e8735be295424cc8b831544e5a20543e3589daf79e76cdb1 |
|
MD5 | a716e305bf3b8ff896f886ac915ad646 |
|
BLAKE2b-256 | de0148041e229b221b12d51cc7c70e5f60862b4c2388d210544926eb46c01d2e |
File details
Details for the file firebirdsql_run-1.0.8a0-py3-none-any.whl
.
File metadata
- Download URL: firebirdsql_run-1.0.8a0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 534d9737fdd83361731dd18b4ab3c43f34a806cca562fc374fa312cc389167ee |
|
MD5 | 0ed66503ffff4f680ef6e78ee1f7f5fd |
|
BLAKE2b-256 | 101d8b498e7cd8ba3820b861ee233b6a72167b5afca61da0c6a557b18872a5c5 |