NAME

Zuzu::Module::DB - std/db builtin module bridge.

DESCRIPTION

This package implements the runtime side of std/db. It exposes DBI-backed classes to ZuzuScript code:

  • DB

    Static constructor helpers:

    • connect(dsn)

      Creates a database handle from a DBI DSN.

    • temp()

      Creates an in-memory SQLite connection.

    • open(path)

      Opens a SQLite database by file path. Accepts either a string or a std/io Path object.

  • DatabaseHandle

    Provides prepare(sql), quote(value), begin, commit, rollback, and execute_batch(sql, rows).

  • StatementHandle

    Provides execute(...), execute_batch(rows), column_names, column_types, next_array, next_dict, all_array, all_dict, next_typed_array, next_typed_dict, all_typed_array, all_typed_dict, and to_Iterator (for for loops yielding typed Dict rows).

All DBI operations are wrapped so DBI failures become runtime errors, which are catchable as exceptions from ZuzuScript.

METHODS

IMPORT

Returns module exports for the runtime importer.

COPYRIGHT AND LICENCE

Zuzu::Module::DB is copyright Toby Inkster.

It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.