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",
    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


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-1.0.7.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

firebirdsql_run-1.0.7-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file firebirdsql_run-1.0.7.tar.gz.

File metadata

  • Download URL: firebirdsql_run-1.0.7.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

Hashes for firebirdsql_run-1.0.7.tar.gz
Algorithm Hash digest
SHA256 598c68cfffc688bece151a9268c195fcf33cd41f4d3306c35e27ab3680f3198a
MD5 48a4f2eff8f04d68dbdb5a7f1510b215
BLAKE2b-256 932758175d4a9f1a541d246a90ed1ffe1d4bf91866de68e7cef6b0a8d076fcdd

See more details on using hashes here.

File details

Details for the file firebirdsql_run-1.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for firebirdsql_run-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 2eb35fe31c1f49bd3740ad2de8f76a437d9ebb9e6411802445ea1c18e9af68ef
MD5 a218ba8046abad7c21700d4cb8705de9
BLAKE2b-256 b1ac2073fc7bfbef6e1819038449554877c56b96e074d10289dadb50e153d65c

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