fbdb 1.5.1
fbdb: ^1.5.1 copied to clipboard
A Firebird SQL database access library for Dart and Flutter.
fbdb examples #
All fbdb examples are split between three subdirectories.
- The
fbdbdirectory contains examples for the high-level, Dart-idiomatic API of FbDb:ex_01_simple_select.dart- shows how to connect to a database, execute aSELECTstatement and fetch the results,ex_02_createdb_dropdb.dart- shows how to create and drop databases using theFbDbattachments,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 customTracingAllocatorto 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.
- The
interfacesdirectory 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 theexamples/interfacessubdirectory of the Firebird root directory). The examples re-implemented in fbdb are:ex_01_create.dart(an equivalent of01.create.cppfrom the Firebird examples) - shows how to create a new database using theIAttachmentinterface,ex_02_update.dart(an equivalent of02.update.cppfrom the Firebird examples) - shows how to executeUPDATEqueries, both with and without prepared statements,ex_03_select.dart(an equivalent of03.select.cppfrom Firebird examples) - demonstrates simpleSELECTstatements with cursors and row fetching,ex_04_print_table.dart(an equivalent of04.print_table.cppfrom the Firebird examples) - displays all tables from the database by querying a system table,ex_07_blob.dart(an equivalent of07.blob.cppfrom the Firebird examples) - shows how to handle both writing and reading of BLOBs,ex_09_service.dart(an equivalent of09.service.cppfrom the Firebird examples) - shows how to communicate with the service manager to obtain database information,ex_10_backup.dart(an equivalent of10.backup.cppfrom the Firebird examples) - shows how to use services manager to make a backup of a database.
- The
tutorialdirectory contains the complete source code and project files for the FbDb Tutorial application.
