GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing postgrespro.github.io — Testgres documentation — testgres 1.5 documentation Testgres documentation¶Testgres is a PostgreSQL testing framework. Installation¶To install testgres, run: pip install testgres We encourage you to use Usage¶Environment¶Note: by default testgres runs There are several ways to specify a custom postgres installation:
Example: export PG_BIN=$HOME/pg_10/bin python my_tests.py Examples¶Here is an example of what you can do with # create a node with random name, port, etc with testgres.get_new_node() as node: # run inidb node.init() # start PostgreSQL node.start() # execute a query in a default DB print(node.execute('select 1')) # ... node stops and its files are about to be removed Backup & replication¶It’s quite easy to create a backup and start a new replica: with testgres.get_new_node('master') as master: master.init().start() # create a backup with master.backup() as backup: # create and start a new replica replica = backup.spawn_replica('replica').start() # catch up with master node replica.catchup() # execute a dummy query print(replica.execute('postgres', 'select 1')) |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |