Expand description
Generic SQL dump helpers used by crate::DatabaseDriver defaults.
Does not emit CREATE DATABASE — drivers that support that option
prepend their dialect preamble in dump_database before calling
dump_sql_database.
Functions§
- build_
create_ table_ sql - Build
CREATE TABLE IF NOT EXISTSDDL from a table schema (host-compatible). - dump_
header_ requests_ single_ transaction - Parse
-- Options:header line from a DataZen dump forsingle-transaction. - dump_
sql_ database - Dump a database to SQL (header, optional DROP, DDL via
dump_table_ddl, INSERTs). - dump_
table_ ddl_ from_ schema - Default
dump_table_ddl: load schema then build CREATE TABLE. - find_
dollar_ tag - Try to match a
$tag$dollar-quote opener starting at positionpos. ReturnsSome(end)whereendis the byte index past the closing$. - restore_
sql_ statements - Default restore: split statements intelligently, execute each non-empty one.
- split_
sql_ statements - Split SQL text into individual statements, respecting single-quoted strings,
double-quoted identifiers, dollar-quoted strings,
--line comments, and/* */block comments so semicolons inside those constructs are not treated as statement terminators.