This PR refactors the test schema into several smaller, more modular files.
For postgres, there are now two schema setup files (..-setup.sql, and ..-setup2.sql) that are used by each of the three data set files.
The data files are much simpler, using psql\ir comments to insert the first or latter parts of the schema around the copy statements.
In addition, support is added for a "fake" replica: which is another connection to the master database, but configured as a "replica". This enables testing a zero-latency replica trivial without having to actually setup an actual db replica.
The prepare.rb script is also updated to show the database initialization steps, as well as showing any errors. When errors occur in the database setup, they now appear in the output (instead of silently being sent to /dev/null).
This PR refactors the test schema into several smaller, more modular files.
For postgres, there are now two schema setup files (
..-setup.sql
, and..-setup2.sql
) that are used by each of the three data set files.The data files are much simpler, using
psql
\ir
comments to insert the first or latter parts of the schema around thecopy
statements.In addition, support is added for a "fake" replica: which is another connection to the master database, but configured as a "replica". This enables testing a zero-latency replica trivial without having to actually setup an actual db replica.
The
prepare.rb
script is also updated to show the database initialization steps, as well as showing any errors. When errors occur in the database setup, they now appear in the output (instead of silently being sent to/dev/null
).