fbdb 1.5.0 copy "fbdb: ^1.5.0" to clipboard
fbdb: ^1.5.0 copied to clipboard

A Firebird SQL database access library for Dart and Flutter.

example/README.md

fbdb examples #

All fbdb examples are split between three subdirectories.

  1. The fbdb directory contains examples for the high-level, Dart-idiomatic API of FbDb:
    • ex_01_simple_select.dart - shows how to connect to a database, execute a SELECT statement and fetch the results,
    • ex_02_createdb_dropdb.dart - shows how to create and drop databases using the FbDb attachments,
    • ex_03_transactions.dart - illustrates transaction handling,
    • ex_04_fetching.dart - shows different methods of fetching rows from the query result set,
    • ex_05_blobs.dart - shows how to handle BLOB data,
    • ex_06_output_params.dart - shows how to obtain results from a stored procedure that is not selectable, i.e. returns its results via output parameters,
    • ex_07_affected_rows.dart - shows how to check how many rows have been affected by a DML query,
    • ex_08_multiple_connections.dart - shows how to open multiple concurrent connections in FbDb,
    • ex_09_lock_wait.dart - illustrates the difference between wait and no wait transactions and the role of the lock timeout parameter,
    • ex_10_errors.dart - shows how to detect and handle errors reported by the server,
    • ex_11_mem_benchmark.dart - strictly speaking it'snot an example, but a simple memory usage benchmark, using a custom TracingAllocator to record all allocations and releases of native memory blocks (including the background worker isolate).
    • ex_12_prepared_statements.dart - shows how to use prepared statements (supported from version 1.3 of fbdb) to speed up repetitive queries. This example inserts 30000 records to a table using traditional queries and prepared queries, and then compares the time each process took, displaying the percentage speedup prepared queries may get you in such scenarios.
    • ex_13_concurrent_transactions.dart - shows how to use multiple concurrent transactions in a single database attachment.
  2. The interfaces directory contains some examples for the low-level API, i.e. the direct FFI bindings to the Firebird client library interfaces. Those are mainly re-implementations of the C++ examples, distributed together with the Firebird server (usually available in the examples/interfaces subdirectory of the Firebird root directory). The examples re-implemented in fbdb are:
    • ex_01_create.dart (an equivalent of 01.create.cpp from the Firebird examples) - shows how to create a new database using the IAttachment interface,
    • ex_02_update.dart (an equivalent of 02.update.cpp from the Firebird examples) - shows how to execute UPDATE queries, both with and without prepared statements,
    • ex_03_select.dart (an equivalent of 03.select.cpp from Firebird examples) - demonstrates simple SELECT statements with cursors and row fetching,
    • ex_04_print_table.dart (an equivalent of 04.print_table.cpp from the Firebird examples) - displays all tables from the database by querying a system table,
    • ex_07_blob.dart (an equivalent of 07.blob.cpp from the Firebird examples) - shows how to handle both writing and reading of BLOBs,
    • ex_09_service.dart (an equivalent of 09.service.cpp from the Firebird examples) - shows how to communicate with the service manager to obtain database information,
    • ex_10_backup.dart (an equivalent of 10.backup.cpp from the Firebird examples) - shows how to use services manager to make a backup of a database.
  3. The tutorial directory contains the complete source code and project files for the FbDb Tutorial application.
13
likes
150
points
92
downloads
screenshot

Publisher

verified publisherhipercom.pl

Weekly Downloads

A Firebird SQL database access library for Dart and Flutter.

Repository (GitHub)
View/report issues

Topics

#database #firebird #fbclient

Documentation

Documentation
API reference

License

BSD-3-Clause (license)

Dependencies

ffi

More

Packages that depend on fbdb