Firebirdsql wrapper inspired by subprocess.run
Project description
firebirdsql-run
Firebirdsql wrapper inspired by subprocess.run
Installation • Examples • Env Variables
Installation
pip install firebirdsql-run
# or
poetry add firebirdsql-run
Examples
Execute a query with read-only access:
from firebirdsql_run import DBAccess, execute
# Execute a query with read-only access.
result = execute(query="SELECT * FROM table", db="database", access=DBAccess.READ_ONLY)
# Output: List of dictionaries containing the query results.
print(result.data)
Execute a query with parameters and log the result:
# Execute a query with parameters.
result = execute(query="INSERT INTO customers (name, age) VALUES (?, ?)", params=("John", 25))
# Log the result.
if result.returncode != 0:
logger.error(result)
else:
logger.info(result)
Execute a query using the existing connection:
# Create a connection object.
conn = connection(db="database", access=DBAccess.READ_ONLY)
# Execute a query using the existing connection.
result = execute(query="SELECT * FROM table", use_conn=conn)
# Close the connection.
conn.close()
# Output: Named tuple representing the completed transaction.
print(result)
An example of a successful transaction:
>>> print(result)
CompletedTransaction(
host="127.0.0.1",
db="database",
user="TWUSER",
access="READ_ONLY",
returncode=0,
exception="",
query="SELECT * FROM table",
params=(),
time=0.001,
data=[
{'id': 1, 'name': 'John Doe', 'department': 'Sales'},
{'id': 2, 'name': 'Jane Smith', 'department': 'Sales'},
],
)
An example of a failed transaction:
>>> print(result)
CompletedTransaction(
host="127.0.0.1",
db="database",
user="TWUSER",
access="READ_ONLY",
returncode=1,
exception="Dynamic SQL Error\nSQL error code = -204\nTable unknown\ntable\nAt line 1, column 15\n",
query="SELECT * FROM table",
params=(),
time=0.001,
data=[],
)
Env Variables
FIREBIRD_KEY=
The FIREBIRD_KEY environment variable can be overridden with the functions 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file firebirdsql_run-1.2.1.tar.gz.
File metadata
- Download URL: firebirdsql_run-1.2.1.tar.gz
- Upload date:
- Size: 80.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93709e47cf8597a91835eec4d394fe73e7173b1596639ab94f5601da7f28b271
|
|
| MD5 |
a6e4508877cb568ba315cac3513e1551
|
|
| BLAKE2b-256 |
21d0b1732c6cb3998e67c3f9c5ae91aaa062f2e7734e475a16919387aa1b53a2
|
Provenance
The following attestation bundles were made for firebirdsql_run-1.2.1.tar.gz:
Publisher:
main.yml on deadnews/firebirdsql-run
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
firebirdsql_run-1.2.1.tar.gz -
Subject digest:
93709e47cf8597a91835eec4d394fe73e7173b1596639ab94f5601da7f28b271 - Sigstore transparency entry: 767783652
- Sigstore integration time:
-
Permalink:
deadnews/firebirdsql-run@606333d4d2cf8c35e88d5d6ffa67ebdeafd3a187 -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/deadnews
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@606333d4d2cf8c35e88d5d6ffa67ebdeafd3a187 -
Trigger Event:
push
-
Statement type:
File details
Details for the file firebirdsql_run-1.2.1-py3-none-any.whl.
File metadata
- Download URL: firebirdsql_run-1.2.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8444503c514fc288d69e815e134c586830af7de2076ed22da7c14c20328b172
|
|
| MD5 |
2bb840286f14118f81e8747c725037ef
|
|
| BLAKE2b-256 |
06007e4147a9428c9c9ca99346f1ab14076d8db6a66da4458ca47220359ea5fa
|
Provenance
The following attestation bundles were made for firebirdsql_run-1.2.1-py3-none-any.whl:
Publisher:
main.yml on deadnews/firebirdsql-run
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
firebirdsql_run-1.2.1-py3-none-any.whl -
Subject digest:
f8444503c514fc288d69e815e134c586830af7de2076ed22da7c14c20328b172 - Sigstore transparency entry: 767783663
- Sigstore integration time:
-
Permalink:
deadnews/firebirdsql-run@606333d4d2cf8c35e88d5d6ffa67ebdeafd3a187 -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/deadnews
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@606333d4d2cf8c35e88d5d6ffa67ebdeafd3a187 -
Trigger Event:
push
-
Statement type: