Triki::Postgres
Inherits Triki::ConfigScaffoldGenerator / Triki::Base / Struct / Value / Object
PostgreSQL dump parser and writer.
Handles COPY ... FROM stdin statements produced by pg_dump.
Instance methods
Reassembles an INSERT/COPY statement from the given rows.
Quotes or formats a single value for the target database dialect.
Postgres uses COPY statements instead of INSERT and look like:
COPY some_table (a, b, c, d) FROM stdin; 1 2 3 4 5 6 7 8 .
This requires the parse methods to persist data (table name and column names) across multiple lines.
Copy statements contain the column values tab separated like so: blah blah blah blah which we want to turn into: [['blah','blah','blah','blah']]
We wrap it in an array to keep it consistent with MySql bulk obfuscation (multiple rows per insert statement)