Skip to main content

Module sql_dump

Module sql_dump 

Source
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 EXISTS DDL from a table schema (host-compatible).
dump_header_requests_single_transaction
Parse -- Options: header line from a DataZen dump for single-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 position pos. Returns Some(end) where end is 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.