Skip to main content

Firebirdsql wrapper inspired by subprocess.run

Project description

firebirdsql-run

Firebirdsql wrapper inspired by subprocess.run

PyPI version Main pre-commit.ci codecov

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",
    access="READ_ONLY",
    returncode=0,
    exception="",
    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",
    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=(),
    data=[],
)

Env variables

FIREBIRD_KEY=

The FIREBIRD_KEY environment variable can be overridden with the function argument passwd.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

firebirdsql_run-2.0.0a0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

firebirdsql_run-2.0.0a0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file firebirdsql_run-2.0.0a0.tar.gz.

File metadata

  • Download URL: firebirdsql_run-2.0.0a0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for firebirdsql_run-2.0.0a0.tar.gz
Algorithm Hash digest
SHA256 1f879359f65b5df4d4295f487efafebb6364e2bbac414e9e516509f9f1b54daf
MD5 cd32cf5778fa5a142459236958275077
BLAKE2b-256 93ef58321e9947c1fcaac5e6fd773e11757a24248855ec5685f28396382e5c59

See more details on using hashes here.

File details

Details for the file firebirdsql_run-2.0.0a0-py3-none-any.whl.

File metadata

File hashes

Hashes for firebirdsql_run-2.0.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 e93a729daa67e62761c01adaa76e774c1e75818babc516afd229737531029855
MD5 0b969759832c3289c6abd9146d5cdb57
BLAKE2b-256 e343617cf85256d418dfd2f8c58197cc4f11552d086d117e1835e7ec0a0afa5c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page