tsukasaoishi / fresh_connection

FreshConnection provides access to one or more configured database replicas.
MIT License
58 stars 11 forks source link

aks/dry up schema loads #18

Closed aks closed 7 years ago

aks commented 7 years ago

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).

tsukasaoishi commented 7 years ago

Thank you for your pull request!.