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.8a3.tar.gz
.
File metadata
- Download URL: firebirdsql_run-1.0.8a3.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cccf94778237e58ada53844e45365078e506f2356c747f453c7cd0b40fa81f0 |
|
MD5 | fb0f09bac6510df37a96d2afbeeacb28 |
|
BLAKE2b-256 | bd8cce3febf08f86b93d7d3a751146050c09d7ff2251b469b190d4d03632c13e |
File details
Details for the file firebirdsql_run-1.0.8a3-py3-none-any.whl
.
File metadata
- Download URL: firebirdsql_run-1.0.8a3-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.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3abff6ac4ad2786b538c3915acf84b0df2bd602dc4741843d309b545683fc927 |
|
MD5 | 67d70f4830f9237082e3944b689bbfde |
|
BLAKE2b-256 | 486c3a2f32b7f5d7e836687be89e070d2841baa99479c55ea2a3bd4a9ec4b00d |