{"repo":"palfrey/wait-for-db","free":true,"listed":false,"github":"https://github.com/palfrey/wait-for-db","clone":"git clone https://github.com/palfrey/wait-for-db.git","description":"Tool to wait until a database is up and responding to a query","language":"Rust","stars":17,"topics":["database","docker","odbc","postgres"],"license":"AGPL-3.0","category":"databases-storage","readme_excerpt":"wait-for-db =========== Basically, wait-for-it but for databases. Often (especially within Dockerised configurations) there is the problem of \"I need the database to be up before step X will work\". Now, if all you need is \"up\" then generally wait-for-it and the database port is enough. If on the other hand you've got migration scripts or other such things you need to run on your database, up isn't enough. wait-for-db lets you wait for a particular database to be both up (in the sense of \"will let you connect without errors\") and optionally \"returns at least one row to a particular query\". It will also attempt to fail immediately for permanent failures (e.g. syntax errors) Usage ----- 1. Download static binary from https://github.com/palfrey/wait-for-db/releases into your Docker image 2. ./wait-for-db Options ------- -m/--mode : postgres or odbc -c/--connection-string : Mode-appropriate connection string. So postgresql:// : @ : or Driver= ; depending on your driver -s/--sql-query : SQL query to run once connected. It should return at least one row, or will be regarded as failing. Default is no query, just be regarded as succeeding the moment it connects. -p/--pause : Pause between attempts for non-permanent failures. Default is 3 seconds -t/--timeout : Time to wait before failing entirely. Default is wait forever. Database support ---------------- Anything you've got an ODBC driver for (which should be most SQL databases) Postgres Development ----------- To test the Postgres/O","default_branch":null,"files":null,"tree":[],"storefront":"/r/palfrey","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/palfrey/wait-for-db/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}