@devoxa/integresql-client
Advanced tools
Weekly downloads
Readme
Installation • Usage • Contributors • License
yarn add @devoxa/integresql-client
To install IntegreSQL, please follow their installation instructions.
For a full usage example, have a look the integration tests.
import { IntegreSQLClient } from '@devoxa/integresql-client'
const integreSQL = new IntegreSQLClient({ url: 'http://localhost:5000' })
// options.url: The URL of the IntegreSQL instance
// The hash can be generated in any way that fits your business logic, the included
// helper creates a SHA1 hash of the file content of all files matching the glob patterns.
const hash = await integreSQL.hashFiles(['./migrations/**/*', './fixtures/**/*'])
await integreSQL.initializeTemplate(hash, async (databaseConfig) => {
await migrateTemplateDatabase(databaseConfig)
await seedTemplateDatabase(databaseConfig)
await disconnectFromDatabase(databaseConfig)
})
const databaseConfig = await integreSQL.getTestDatabase(hash)
integreSQL.databaseConfigToConnectionUrl(databaseConfig)
You can directly send requests to the IntegreSQL instance via the included API client, or optionally
instantiate a new IntegreSQLApiClient
yourself.
await integreSQL.api.reuseTestDatabase(hash, id)
const api = new IntegreSQLApiClient({ url: 'http://localhost:5000' })
await api.reuseTestDatabase(hash, id)
Thanks goes to these wonderful people (emoji key):
David Reeß 💻 📖 ⚠️ |
This project follows the all-contributors specification. Contributions of any kind welcome!
MIT
FAQs
IntegreSQL client for managing isolated PostgreSQL databases in integration tests
The npm package @devoxa/integresql-client receives a total of 703 weekly downloads. As such, @devoxa/integresql-client popularity was classified as not popular.
We found that @devoxa/integresql-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.