├── packages ├── embedded-postgres │ ├── tests │ │ ├── .gitignore │ │ └── index.test.ts │ ├── .eslintrc.cjs │ ├── docs │ │ ├── .nojekyll │ │ ├── modules.md │ │ ├── README.md │ │ └── interfaces │ │ │ └── PostgresOptions.md │ ├── vitest.config.ts │ ├── tsconfig.json │ ├── package.json │ ├── src │ │ ├── binary.ts │ │ ├── types.ts │ │ └── index.ts │ └── README.md ├── darwin-x64 │ ├── .eslintrc.cjs │ ├── scripts │ │ ├── download.js │ │ └── hydrate-symlinks.js │ ├── tsconfig.json │ ├── src │ │ └── index.ts │ ├── package.json │ └── README.md ├── downloader │ ├── .eslintrc.cjs │ ├── tsconfig.json │ ├── package.json │ └── src │ │ └── index.ts ├── linux-arm │ ├── .eslintrc.cjs │ ├── scripts │ │ ├── download.js │ │ └── hydrate-symlinks.js │ ├── tsconfig.json │ ├── src │ │ └── index.ts │ ├── package.json │ ├── README.md │ └── package-lock.json ├── linux-ia32 │ ├── .eslintrc.cjs │ ├── scripts │ │ ├── download.js │ │ └── hydrate-symlinks.js │ ├── tsconfig.json │ ├── src │ │ └── index.ts │ ├── package.json │ └── README.md ├── linux-x64 │ ├── .eslintrc.cjs │ ├── scripts │ │ ├── download.js │ │ └── hydrate-symlinks.js │ ├── tsconfig.json │ ├── src │ │ └── index.ts │ ├── package.json │ └── README.md ├── darwin-arm64 │ ├── .eslintrc.cjs │ ├── scripts │ │ ├── download.js │ │ └── hydrate-symlinks.js │ ├── tsconfig.json │ ├── src │ │ └── index.ts │ ├── package.json │ └── README.md ├── linux-arm64 │ ├── .eslintrc.cjs │ ├── scripts │ │ ├── download.js │ │ └── hydrate-symlinks.js │ ├── tsconfig.json │ ├── src │ │ └── index.ts │ ├── package.json │ └── README.md ├── linux-ppc64 │ ├── .eslintrc.cjs │ ├── scripts │ │ ├── download.js │ │ └── hydrate-symlinks.js │ ├── tsconfig.json │ ├── src │ │ └── index.ts │ ├── package.json │ └── README.md ├── symlink-reader │ ├── .eslintrc.cjs │ ├── tsconfig.json │ ├── package.json │ └── src │ │ └── index.ts └── windows-x64 │ ├── .eslintrc.cjs │ ├── scripts │ ├── download.js │ └── hydrate-symlinks.js │ ├── tsconfig.json │ ├── src │ └── index.ts │ ├── package.json │ └── README.md ├── .gitattributes ├── .eslintignore ├── lerna.json ├── tsconfig.json ├── .eslintrc.cjs ├── .github └── workflows │ └── test.yml ├── LICENSE.md ├── package.json ├── scripts └── release-new-version.js ├── .gitignore ├── docs └── images │ ├── logo-bmd.svg │ └── logo-falkland.svg ├── README.md └── CHANGELOG.md /packages/embedded-postgres/tests/.gitignore: -------------------------------------------------------------------------------- 1 | data/db -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.ts text eol=lf 2 | *.js text eol=lf 3 | *.cjs text eol=lf 4 | *.json text eol=lf -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | **/dist/** 2 | **/node_modules/** 3 | tsconfig.json 4 | .eslintrc.js 5 | **/scripts/** -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | "packages/*" 4 | ], 5 | "version": "18.1.0-beta.15" 6 | } 7 | -------------------------------------------------------------------------------- /packages/darwin-x64/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '../../.eslintrc.cjs', 3 | parserOptions: { 4 | project: './tsconfig.json', 5 | } 6 | }; -------------------------------------------------------------------------------- /packages/downloader/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '../../.eslintrc.cjs', 3 | parserOptions: { 4 | project: './tsconfig.json', 5 | } 6 | }; -------------------------------------------------------------------------------- /packages/linux-arm/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '../../.eslintrc.cjs', 3 | parserOptions: { 4 | project: './tsconfig.json', 5 | } 6 | }; -------------------------------------------------------------------------------- /packages/linux-ia32/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '../../.eslintrc.cjs', 3 | parserOptions: { 4 | project: './tsconfig.json', 5 | } 6 | }; -------------------------------------------------------------------------------- /packages/linux-x64/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '../../.eslintrc.cjs', 3 | parserOptions: { 4 | project: './tsconfig.json', 5 | } 6 | }; -------------------------------------------------------------------------------- /packages/darwin-arm64/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '../../.eslintrc.cjs', 3 | parserOptions: { 4 | project: './tsconfig.json', 5 | } 6 | }; -------------------------------------------------------------------------------- /packages/linux-arm64/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '../../.eslintrc.cjs', 3 | parserOptions: { 4 | project: './tsconfig.json', 5 | } 6 | }; -------------------------------------------------------------------------------- /packages/linux-ppc64/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '../../.eslintrc.cjs', 3 | parserOptions: { 4 | project: './tsconfig.json', 5 | } 6 | }; -------------------------------------------------------------------------------- /packages/symlink-reader/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '../../.eslintrc.cjs', 3 | parserOptions: { 4 | project: './tsconfig.json', 5 | } 6 | }; -------------------------------------------------------------------------------- /packages/windows-x64/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '../../.eslintrc.cjs', 3 | parserOptions: { 4 | project: './tsconfig.json', 5 | } 6 | }; -------------------------------------------------------------------------------- /packages/embedded-postgres/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '../../.eslintrc.cjs', 3 | parserOptions: { 4 | project: './tsconfig.json', 5 | } 6 | }; -------------------------------------------------------------------------------- /packages/embedded-postgres/docs/.nojekyll: -------------------------------------------------------------------------------- 1 | TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. -------------------------------------------------------------------------------- /packages/embedded-postgres/docs/modules.md: -------------------------------------------------------------------------------- 1 | [embedded-postgres](README.md) / Exports 2 | 3 | # embedded-postgres 4 | 5 | ## Table of contents 6 | 7 | ### Interfaces 8 | 9 | - [PostgresOptions](interfaces/PostgresOptions.md) 10 | -------------------------------------------------------------------------------- /packages/embedded-postgres/vitest.config.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { defineConfig } from 'vite' 3 | 4 | export default defineConfig({ 5 | test: { 6 | bail: 1, 7 | testTimeout: 120_000, 8 | hookTimeout: 30_000, 9 | }, 10 | }) -------------------------------------------------------------------------------- /packages/darwin-arm64/scripts/download.js: -------------------------------------------------------------------------------- 1 | import { downloadBinaries } from '@embedded-postgres/downloader'; 2 | import { readSymlinks } from '@embedded-postgres/symlink-reader'; 3 | import packageJson from '../package.json' with { type: "json" }; 4 | downloadBinaries(process.argv, packageJson).then(readSymlinks); -------------------------------------------------------------------------------- /packages/darwin-x64/scripts/download.js: -------------------------------------------------------------------------------- 1 | import { downloadBinaries } from '@embedded-postgres/downloader'; 2 | import { readSymlinks } from '@embedded-postgres/symlink-reader'; 3 | import packageJson from '../package.json' with { type: "json" }; 4 | downloadBinaries(process.argv, packageJson).then(readSymlinks); -------------------------------------------------------------------------------- /packages/linux-arm/scripts/download.js: -------------------------------------------------------------------------------- 1 | import { downloadBinaries } from '@embedded-postgres/downloader'; 2 | import { readSymlinks } from '@embedded-postgres/symlink-reader'; 3 | import packageJson from '../package.json' with { type: "json" }; 4 | downloadBinaries(process.argv, packageJson).then(readSymlinks); -------------------------------------------------------------------------------- /packages/linux-arm64/scripts/download.js: -------------------------------------------------------------------------------- 1 | import { downloadBinaries } from '@embedded-postgres/downloader'; 2 | import { readSymlinks } from '@embedded-postgres/symlink-reader'; 3 | import packageJson from '../package.json' with { type: "json" }; 4 | downloadBinaries(process.argv, packageJson).then(readSymlinks); -------------------------------------------------------------------------------- /packages/linux-ia32/scripts/download.js: -------------------------------------------------------------------------------- 1 | import { downloadBinaries } from '@embedded-postgres/downloader'; 2 | import { readSymlinks } from '@embedded-postgres/symlink-reader'; 3 | import packageJson from '../package.json' with { type: "json" }; 4 | downloadBinaries(process.argv, packageJson).then(readSymlinks); -------------------------------------------------------------------------------- /packages/linux-ppc64/scripts/download.js: -------------------------------------------------------------------------------- 1 | import { downloadBinaries } from '@embedded-postgres/downloader'; 2 | import { readSymlinks } from '@embedded-postgres/symlink-reader'; 3 | import packageJson from '../package.json' with { type: "json" }; 4 | downloadBinaries(process.argv, packageJson).then(readSymlinks); -------------------------------------------------------------------------------- /packages/linux-x64/scripts/download.js: -------------------------------------------------------------------------------- 1 | import { downloadBinaries } from '@embedded-postgres/downloader'; 2 | import { readSymlinks } from '@embedded-postgres/symlink-reader'; 3 | import packageJson from '../package.json' with { type: "json" }; 4 | downloadBinaries(process.argv, packageJson).then(readSymlinks); -------------------------------------------------------------------------------- /packages/windows-x64/scripts/download.js: -------------------------------------------------------------------------------- 1 | import { downloadBinaries } from '@embedded-postgres/downloader'; 2 | import { readSymlinks } from '@embedded-postgres/symlink-reader'; 3 | import packageJson from '../package.json' with { type: "json" }; 4 | downloadBinaries(process.argv, packageJson).then(readSymlinks); -------------------------------------------------------------------------------- /packages/darwin-x64/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "./src", 5 | "outDir": "./dist", 6 | "baseUrl": ".", 7 | "composite": true, 8 | }, 9 | "include": ["src/**/*"], 10 | "exclude": ["node_modules", "dist"] 11 | } -------------------------------------------------------------------------------- /packages/downloader/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "./src", 5 | "outDir": "./dist", 6 | "baseUrl": ".", 7 | "composite": true, 8 | }, 9 | "include": ["src/**/*"], 10 | "exclude": ["node_modules", "dist"] 11 | } -------------------------------------------------------------------------------- /packages/linux-arm/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "./src", 5 | "outDir": "./dist", 6 | "baseUrl": ".", 7 | "composite": true, 8 | }, 9 | "include": ["src/**/*"], 10 | "exclude": ["node_modules", "dist"] 11 | } -------------------------------------------------------------------------------- /packages/linux-ia32/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "./src", 5 | "outDir": "./dist", 6 | "baseUrl": ".", 7 | "composite": true, 8 | }, 9 | "include": ["src/**/*"], 10 | "exclude": ["node_modules", "dist"] 11 | } -------------------------------------------------------------------------------- /packages/linux-x64/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "./src", 5 | "outDir": "./dist", 6 | "baseUrl": ".", 7 | "composite": true, 8 | }, 9 | "include": ["src/**/*"], 10 | "exclude": ["node_modules", "dist"] 11 | } -------------------------------------------------------------------------------- /packages/darwin-arm64/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "./src", 5 | "outDir": "./dist", 6 | "baseUrl": ".", 7 | "composite": true, 8 | }, 9 | "include": ["src/**/*"], 10 | "exclude": ["node_modules", "dist"] 11 | } -------------------------------------------------------------------------------- /packages/linux-arm64/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "./src", 5 | "outDir": "./dist", 6 | "baseUrl": ".", 7 | "composite": true, 8 | }, 9 | "include": ["src/**/*"], 10 | "exclude": ["node_modules", "dist"] 11 | } -------------------------------------------------------------------------------- /packages/linux-ppc64/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "./src", 5 | "outDir": "./dist", 6 | "baseUrl": ".", 7 | "composite": true, 8 | }, 9 | "include": ["src/**/*"], 10 | "exclude": ["node_modules", "dist"] 11 | } -------------------------------------------------------------------------------- /packages/symlink-reader/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "./src", 5 | "outDir": "./dist", 6 | "baseUrl": ".", 7 | "composite": true, 8 | }, 9 | "include": ["src/**/*"], 10 | "exclude": ["node_modules", "dist"] 11 | } -------------------------------------------------------------------------------- /packages/windows-x64/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "./src", 5 | "outDir": "./dist", 6 | "baseUrl": ".", 7 | "composite": true, 8 | }, 9 | "include": ["src/**/*"], 10 | "exclude": ["node_modules", "dist"] 11 | } -------------------------------------------------------------------------------- /packages/embedded-postgres/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "./src", 5 | "outDir": "./dist", 6 | "baseUrl": "./", 7 | "composite": true, 8 | }, 9 | "include": ["./src"], 10 | "exclude": ["node_modules", "dist"], 11 | } -------------------------------------------------------------------------------- /packages/darwin-arm64/src/index.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { fileURLToPath } from 'url'; 3 | 4 | const __dirname = path.dirname(fileURLToPath(import.meta.url)); 5 | export const pg_ctl = path.resolve(__dirname, '..', 'native', 'bin', 'pg_ctl'); 6 | export const initdb = path.resolve(__dirname, '..', 'native', 'bin', 'initdb'); 7 | export const postgres = path.resolve(__dirname, '..', 'native', 'bin', 'postgres'); 8 | -------------------------------------------------------------------------------- /packages/darwin-x64/src/index.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { fileURLToPath } from 'url'; 3 | 4 | const __dirname = path.dirname(fileURLToPath(import.meta.url)); 5 | export const pg_ctl = path.resolve(__dirname, '..', 'native', 'bin', 'pg_ctl'); 6 | export const initdb = path.resolve(__dirname, '..', 'native', 'bin', 'initdb'); 7 | export const postgres = path.resolve(__dirname, '..', 'native', 'bin', 'postgres'); 8 | -------------------------------------------------------------------------------- /packages/linux-arm/src/index.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { fileURLToPath } from 'url'; 3 | 4 | const __dirname = path.dirname(fileURLToPath(import.meta.url)); 5 | export const pg_ctl = path.resolve(__dirname, '..', 'native', 'bin', 'pg_ctl'); 6 | export const initdb = path.resolve(__dirname, '..', 'native', 'bin', 'initdb'); 7 | export const postgres = path.resolve(__dirname, '..', 'native', 'bin', 'postgres'); 8 | -------------------------------------------------------------------------------- /packages/linux-arm64/src/index.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { fileURLToPath } from 'url'; 3 | 4 | const __dirname = path.dirname(fileURLToPath(import.meta.url)); 5 | export const pg_ctl = path.resolve(__dirname, '..', 'native', 'bin', 'pg_ctl'); 6 | export const initdb = path.resolve(__dirname, '..', 'native', 'bin', 'initdb'); 7 | export const postgres = path.resolve(__dirname, '..', 'native', 'bin', 'postgres'); 8 | -------------------------------------------------------------------------------- /packages/linux-ia32/src/index.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { fileURLToPath } from 'url'; 3 | 4 | const __dirname = path.dirname(fileURLToPath(import.meta.url)); 5 | export const pg_ctl = path.resolve(__dirname, '..', 'native', 'bin', 'pg_ctl'); 6 | export const initdb = path.resolve(__dirname, '..', 'native', 'bin', 'initdb'); 7 | export const postgres = path.resolve(__dirname, '..', 'native', 'bin', 'postgres'); 8 | -------------------------------------------------------------------------------- /packages/linux-ppc64/src/index.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { fileURLToPath } from 'url'; 3 | 4 | const __dirname = path.dirname(fileURLToPath(import.meta.url)); 5 | export const pg_ctl = path.resolve(__dirname, '..', 'native', 'bin', 'pg_ctl'); 6 | export const initdb = path.resolve(__dirname, '..', 'native', 'bin', 'initdb'); 7 | export const postgres = path.resolve(__dirname, '..', 'native', 'bin', 'postgres'); 8 | -------------------------------------------------------------------------------- /packages/linux-x64/src/index.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { fileURLToPath } from 'url'; 3 | 4 | const __dirname = path.dirname(fileURLToPath(import.meta.url)); 5 | export const pg_ctl = path.resolve(__dirname, '..', 'native', 'bin', 'pg_ctl'); 6 | export const initdb = path.resolve(__dirname, '..', 'native', 'bin', 'initdb'); 7 | export const postgres = path.resolve(__dirname, '..', 'native', 'bin', 'postgres'); 8 | -------------------------------------------------------------------------------- /packages/windows-x64/src/index.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { fileURLToPath } from 'url'; 3 | 4 | const __dirname = path.dirname(fileURLToPath(import.meta.url)); 5 | export const pg_ctl = path.resolve(__dirname, '..', 'native', 'bin', 'pg_ctl.exe'); 6 | export const initdb = path.resolve(__dirname, '..', 'native', 'bin', 'initdb.exe'); 7 | export const postgres = path.resolve(__dirname, '..', 'native', 'bin', 'postgres.exe'); 8 | 9 | -------------------------------------------------------------------------------- /packages/symlink-reader/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@embedded-postgres/symlink-reader", 3 | "version": "18.1.0-beta.15", 4 | "description": "A helper to detect symlinks", 5 | "exports": "./dist/index.js", 6 | "type": "module", 7 | "private": true, 8 | "scripts": { 9 | "start": "tsc -w", 10 | "build": "tsc", 11 | "lint": "eslint ./src --ext ts" 12 | }, 13 | "author": "Lei Nelissen", 14 | "license": "MIT", 15 | "devDependencies": { 16 | "eslint": "^8.56.0", 17 | "typescript": "^4.7.3" 18 | }, 19 | "engines": { 20 | "node": ">=16" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/downloader/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@embedded-postgres/downloader", 3 | "version": "18.1.0-beta.15", 4 | "description": "A helper to download PostgresQL binaries", 5 | "exports": "./dist/index.js", 6 | "type": "module", 7 | "private": true, 8 | "scripts": { 9 | "start": "tsc -w", 10 | "build": "tsc", 11 | "lint": "eslint ./src --ext ts" 12 | }, 13 | "author": "Lei Nelissen", 14 | "license": "MIT", 15 | "devDependencies": { 16 | "@types/adm-zip": "^0.5.5", 17 | "@types/tar": "^6.1.1", 18 | "eslint": "^8.56.0", 19 | "typescript": "^4.7.3" 20 | }, 21 | "dependencies": { 22 | "adm-zip": "^0.5.9", 23 | "semver": "^7.5.4" 24 | }, 25 | "engines": { 26 | "node": ">=16" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["es2022"], 4 | "target": "es2015", 5 | "incremental": true, 6 | "outDir": "./dist", 7 | "baseUrl": ".", 8 | "module": "Node16", 9 | "moduleResolution": "Node16", 10 | "resolveJsonModule": true, 11 | "esModuleInterop": true, 12 | "strict": true, 13 | "paths": { 14 | "@embedded-postgres/*": [ 15 | "packages/*/src/index.ts", 16 | ], 17 | "embedded-postgres": [ 18 | "packages/embedded-postgres/src/index.ts", 19 | ] 20 | } 21 | 22 | }, 23 | "references": [ 24 | { 25 | "path": "packages/embedded-postgres" 26 | } 27 | ], 28 | "exclude": ["node_modules", "dist", "**/*.spec.ts"] 29 | } -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | es2021: true, 4 | node: true 5 | }, 6 | extends: [ 7 | 'eslint:recommended', 8 | 'plugin:@typescript-eslint/recommended' 9 | ], 10 | parser: '@typescript-eslint/parser', 11 | parserOptions: { 12 | ecmaVersion: 'latest', 13 | sourceType: 'module' 14 | }, 15 | plugins: [ 16 | '@typescript-eslint' 17 | ], 18 | rules: { 19 | indent: [ 20 | 'error', 21 | 4, 22 | { SwitchCase: 1 } 23 | ], 24 | 'linebreak-style': [ 25 | 'error', 26 | 'unix' 27 | ], 28 | quotes: [ 29 | 'error', 30 | 'single' 31 | ], 32 | semi: [ 33 | 'error', 34 | 'always' 35 | ] 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json 2 | name: Test 3 | 4 | on: [push] 5 | 6 | jobs: 7 | test: 8 | name: 'Test' 9 | strategy: 10 | fail-fast: false 11 | matrix: 12 | os: [ubuntu-latest, windows-latest, macos-latest, macos-13] 13 | runs-on: ${{ matrix.os }} 14 | 15 | steps: 16 | - uses: actions/checkout@v4 17 | - uses: actions/setup-node@v4 18 | with: 19 | node-version: 20.x 20 | - run: npm ci --force 21 | - run: npm run build 22 | - run: npm run lint 23 | - run: npm run download 24 | - name: Run test 25 | if: matrix.os != 'windows-latest' 26 | run: | 27 | cd packages/embedded-postgres 28 | npm test 29 | - name: Run test (NL locale) 30 | env: 31 | LC_ALL: nl_NL.utf8 32 | if: matrix.os != 'windows-latest' 33 | run: | 34 | cd packages/embedded-postgres 35 | npm test 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Lei Nelissen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "root", 3 | "author": { 4 | "name": "Lei Nelissen" 5 | }, 6 | "private": true, 7 | "license": "MIT", 8 | "version": "1.0.0", 9 | "type": "module", 10 | "scripts": { 11 | "lint": "lerna run lint --parallel", 12 | "start": "lerna run start --parallel", 13 | "build": "lerna run build", 14 | "download": "lerna run download --parallel", 15 | "download-all": "lerna run download --parallel -- -- --all", 16 | "docs": "lerna run docs --parallel", 17 | "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0", 18 | "test": "lerna run test" 19 | }, 20 | "devDependencies": { 21 | "@tsconfig/node20": "^20.1.2", 22 | "@types/node": "^20.10.5", 23 | "@typescript-eslint/eslint-plugin": "^6.15.0", 24 | "@typescript-eslint/parser": "^6.15.0", 25 | "conventional-changelog-cli": "^3.0.0", 26 | "eslint": "^8.56.0", 27 | "lerna": "^5.0.0", 28 | "typedoc": "^0.24.8", 29 | "typedoc-plugin-markdown": "^3.15.3", 30 | "typescript": "^4.7.3" 31 | }, 32 | "workspaces": [ 33 | "packages/*" 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /packages/linux-arm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@embedded-postgres/linux-arm", 3 | "version": "18.1.0-beta.15", 4 | "description": "A package containing the Postgres binaries for a particular architecture and operating system. See the embedded-postgres package.", 5 | "exports": "./dist/index.js", 6 | "type": "module", 7 | "scripts": { 8 | "start": "tsc -w", 9 | "build": "tsc", 10 | "lint": "eslint ./src --ext ts", 11 | "download": "node scripts/download.js", 12 | "postinstall": "node scripts/hydrate-symlinks.js" 13 | }, 14 | "author": "Lei Nelissen", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/leinelissen/embedded-postgres" 18 | }, 19 | "license": "MIT", 20 | "os": [ 21 | "linux" 22 | ], 23 | "cpu": [ 24 | "arm" 25 | ], 26 | "devDependencies": { 27 | "@embedded-postgres/downloader": "^18.1.0-beta.15", 28 | "@embedded-postgres/symlink-reader": "^18.1.0-beta.15" 29 | }, 30 | "publishConfig": { 31 | "access": "public" 32 | }, 33 | "files": [ 34 | "/dist/**/*", 35 | "/native/**/*", 36 | "/scripts/hydrate-symlinks.js" 37 | ], 38 | "engines": { 39 | "node": ">=16" 40 | }, 41 | "gitHead": "5b3e39624b6a9a1e3d53404684ee1239efa19020" 42 | } 43 | -------------------------------------------------------------------------------- /packages/linux-x64/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@embedded-postgres/linux-x64", 3 | "version": "18.1.0-beta.15", 4 | "description": "A package containing the Postgres binaries for a particular architecture and operating system. See the embedded-postgres package.", 5 | "exports": "./dist/index.js", 6 | "type": "module", 7 | "scripts": { 8 | "start": "tsc -w", 9 | "build": "tsc", 10 | "lint": "eslint ./src --ext ts", 11 | "download": "node scripts/download.js", 12 | "postinstall": "node scripts/hydrate-symlinks.js" 13 | }, 14 | "author": "Lei Nelissen", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/leinelissen/embedded-postgres" 18 | }, 19 | "license": "MIT", 20 | "os": [ 21 | "linux" 22 | ], 23 | "cpu": [ 24 | "x64" 25 | ], 26 | "devDependencies": { 27 | "@embedded-postgres/downloader": "^18.1.0-beta.15", 28 | "@embedded-postgres/symlink-reader": "^18.1.0-beta.15" 29 | }, 30 | "publishConfig": { 31 | "access": "public" 32 | }, 33 | "files": [ 34 | "/dist/**/*", 35 | "/native/**/*", 36 | "/scripts/hydrate-symlinks.js" 37 | ], 38 | "engines": { 39 | "node": ">=16" 40 | }, 41 | "gitHead": "5b3e39624b6a9a1e3d53404684ee1239efa19020" 42 | } 43 | -------------------------------------------------------------------------------- /packages/darwin-x64/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@embedded-postgres/darwin-x64", 3 | "version": "18.1.0-beta.15", 4 | "description": "A package containing the Postgres binaries for a particular architecture and operating system. See the embedded-postgres package.", 5 | "exports": "./dist/index.js", 6 | "type": "module", 7 | "scripts": { 8 | "start": "tsc -w", 9 | "build": "tsc", 10 | "lint": "eslint ./src --ext ts", 11 | "download": "node scripts/download.js", 12 | "postinstall": "node scripts/hydrate-symlinks.js" 13 | }, 14 | "author": "Lei Nelissen", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/leinelissen/embedded-postgres" 18 | }, 19 | "license": "MIT", 20 | "os": [ 21 | "darwin" 22 | ], 23 | "cpu": [ 24 | "x64" 25 | ], 26 | "devDependencies": { 27 | "@embedded-postgres/downloader": "^18.1.0-beta.15", 28 | "@embedded-postgres/symlink-reader": "^18.1.0-beta.15" 29 | }, 30 | "publishConfig": { 31 | "access": "public" 32 | }, 33 | "files": [ 34 | "/dist/**/*", 35 | "/native/**/*", 36 | "/scripts/hydrate-symlinks.js" 37 | ], 38 | "engines": { 39 | "node": ">=16" 40 | }, 41 | "gitHead": "5b3e39624b6a9a1e3d53404684ee1239efa19020" 42 | } 43 | -------------------------------------------------------------------------------- /packages/linux-arm64/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@embedded-postgres/linux-arm64", 3 | "version": "18.1.0-beta.15", 4 | "description": "A package containing the Postgres binaries for a particular architecture and operating system. See the embedded-postgres package.", 5 | "exports": "./dist/index.js", 6 | "type": "module", 7 | "scripts": { 8 | "start": "tsc -w", 9 | "build": "tsc", 10 | "lint": "eslint ./src --ext ts", 11 | "download": "node scripts/download.js", 12 | "postinstall": "node scripts/hydrate-symlinks.js" 13 | }, 14 | "author": "Lei Nelissen", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/leinelissen/embedded-postgres" 18 | }, 19 | "license": "MIT", 20 | "os": [ 21 | "linux" 22 | ], 23 | "cpu": [ 24 | "arm64" 25 | ], 26 | "devDependencies": { 27 | "@embedded-postgres/downloader": "^18.1.0-beta.15", 28 | "@embedded-postgres/symlink-reader": "^18.1.0-beta.15" 29 | }, 30 | "publishConfig": { 31 | "access": "public" 32 | }, 33 | "files": [ 34 | "/dist/**/*", 35 | "/native/**/*", 36 | "/scripts/hydrate-symlinks.js" 37 | ], 38 | "engines": { 39 | "node": ">=16" 40 | }, 41 | "gitHead": "5b3e39624b6a9a1e3d53404684ee1239efa19020" 42 | } 43 | -------------------------------------------------------------------------------- /packages/linux-ia32/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@embedded-postgres/linux-ia32", 3 | "version": "18.1.0-beta.15", 4 | "description": "A package containing the Postgres binaries for a particular architecture and operating system. See the embedded-postgres package.", 5 | "exports": "./dist/index.js", 6 | "type": "module", 7 | "scripts": { 8 | "start": "tsc -w", 9 | "build": "tsc", 10 | "lint": "eslint ./src --ext ts", 11 | "download": "node scripts/download.js", 12 | "postinstall": "node scripts/hydrate-symlinks.js" 13 | }, 14 | "author": "Lei Nelissen", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/leinelissen/embedded-postgres" 18 | }, 19 | "license": "MIT", 20 | "os": [ 21 | "linux" 22 | ], 23 | "cpu": [ 24 | "ia32" 25 | ], 26 | "devDependencies": { 27 | "@embedded-postgres/downloader": "^18.1.0-beta.15", 28 | "@embedded-postgres/symlink-reader": "^18.1.0-beta.15" 29 | }, 30 | "publishConfig": { 31 | "access": "public" 32 | }, 33 | "files": [ 34 | "/dist/**/*", 35 | "/native/**/*", 36 | "/scripts/hydrate-symlinks.js" 37 | ], 38 | "engines": { 39 | "node": ">=16" 40 | }, 41 | "gitHead": "5b3e39624b6a9a1e3d53404684ee1239efa19020" 42 | } 43 | -------------------------------------------------------------------------------- /packages/linux-ppc64/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@embedded-postgres/linux-ppc64", 3 | "version": "18.1.0-beta.15", 4 | "description": "A package containing the Postgres binaries for a particular architecture and operating system. See the embedded-postgres package.", 5 | "exports": "./dist/index.js", 6 | "type": "module", 7 | "scripts": { 8 | "start": "tsc -w", 9 | "build": "tsc", 10 | "lint": "eslint ./src --ext ts", 11 | "download": "node scripts/download.js", 12 | "postinstall": "node scripts/hydrate-symlinks.js" 13 | }, 14 | "author": "Lei Nelissen", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/leinelissen/embedded-postgres" 18 | }, 19 | "license": "MIT", 20 | "os": [ 21 | "linux" 22 | ], 23 | "cpu": [ 24 | "ppc64" 25 | ], 26 | "devDependencies": { 27 | "@embedded-postgres/downloader": "^18.1.0-beta.15", 28 | "@embedded-postgres/symlink-reader": "^18.1.0-beta.15" 29 | }, 30 | "publishConfig": { 31 | "access": "public" 32 | }, 33 | "files": [ 34 | "/dist/**/*", 35 | "/native/**/*", 36 | "/scripts/hydrate-symlinks.js" 37 | ], 38 | "engines": { 39 | "node": ">=16" 40 | }, 41 | "gitHead": "5b3e39624b6a9a1e3d53404684ee1239efa19020" 42 | } 43 | -------------------------------------------------------------------------------- /packages/windows-x64/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@embedded-postgres/windows-x64", 3 | "version": "18.1.0-beta.15", 4 | "description": "A package containing the Postgres binaries for a particular architecture and operating system. See the embedded-postgres package.", 5 | "exports": "./dist/index.js", 6 | "type": "module", 7 | "scripts": { 8 | "start": "tsc -w", 9 | "build": "tsc", 10 | "lint": "eslint ./src --ext ts", 11 | "download": "node scripts/download.js", 12 | "postinstall": "node scripts/hydrate-symlinks.js" 13 | }, 14 | "author": "Lei Nelissen", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/leinelissen/embedded-postgres" 18 | }, 19 | "license": "MIT", 20 | "os": [ 21 | "win32" 22 | ], 23 | "cpu": [ 24 | "x64" 25 | ], 26 | "devDependencies": { 27 | "@embedded-postgres/downloader": "^18.1.0-beta.15", 28 | "@embedded-postgres/symlink-reader": "^18.1.0-beta.15" 29 | }, 30 | "publishConfig": { 31 | "access": "public" 32 | }, 33 | "files": [ 34 | "/dist/**/*", 35 | "/native/**/*", 36 | "/scripts/hydrate-symlinks.js" 37 | ], 38 | "engines": { 39 | "node": ">=16" 40 | }, 41 | "gitHead": "5b3e39624b6a9a1e3d53404684ee1239efa19020" 42 | } 43 | -------------------------------------------------------------------------------- /packages/darwin-arm64/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@embedded-postgres/darwin-arm64", 3 | "version": "18.1.0-beta.15", 4 | "description": "A package containing the Postgres binaries for a particular architecture and operating system. See the embedded-postgres package.", 5 | "exports": "./dist/index.js", 6 | "type": "module", 7 | "scripts": { 8 | "start": "tsc -w", 9 | "build": "tsc", 10 | "lint": "eslint ./src --ext ts", 11 | "download": "node scripts/download.js", 12 | "postinstall": "node scripts/hydrate-symlinks.js" 13 | }, 14 | "author": "Lei Nelissen", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/leinelissen/embedded-postgres" 18 | }, 19 | "license": "MIT", 20 | "os": [ 21 | "darwin" 22 | ], 23 | "cpu": [ 24 | "arm64" 25 | ], 26 | "devDependencies": { 27 | "@embedded-postgres/downloader": "^18.1.0-beta.15", 28 | "@embedded-postgres/symlink-reader": "^18.1.0-beta.15" 29 | }, 30 | "publishConfig": { 31 | "access": "public" 32 | }, 33 | "files": [ 34 | "/dist/**/*", 35 | "/native/**/*", 36 | "/scripts/hydrate-symlinks.js" 37 | ], 38 | "engines": { 39 | "node": ">=16" 40 | }, 41 | "gitHead": "5b3e39624b6a9a1e3d53404684ee1239efa19020" 42 | } 43 | -------------------------------------------------------------------------------- /packages/embedded-postgres/docs/README.md: -------------------------------------------------------------------------------- 1 | embedded-postgres / [Exports](modules.md) 2 | 3 | # embedded-postgres 4 | A Node package that allows you to spawn a Postgresql cluster programatically. 5 | 6 | ## Usage 7 | ``` 8 | npm i embedded-postgres 9 | ``` 10 | 11 | ```ts 12 | import EmbeddedPostgres from 'embedded-postgres'; 13 | 14 | async function main() { 15 | // Create the object 16 | const pg = new EmbeddedPostgres({ 17 | databaseDir: './data/db', 18 | user: 'postgres', 19 | password: 'password', 20 | port: 5432, 21 | persistent: true, 22 | }); 23 | 24 | // Create the cluster config files 25 | await pg.inititialize(); 26 | 27 | // Start the server 28 | await pg.start(); 29 | 30 | // Create and/or drop database 31 | await pg.createDatabase('TEST'); 32 | await pg.dropDatabase('TEST'); 33 | 34 | // Initialize a node-postgres client 35 | const client = pg.getPgClient(); 36 | await client.connect(); 37 | const result = await client.query('SELECT datname FROM pg_database'); 38 | 39 | // Stop the server 40 | await pg.stop(); 41 | } 42 | 43 | main(); 44 | ``` 45 | 46 | ## Credits 47 | Embedded Postgres was created by Lei Nelissen for [BMD 48 | Studio](https://bmd.studio). It is based on [zonky's embedded-postgres-binaries](https://github.com/zonkyio/embedded-postgres). 49 | -------------------------------------------------------------------------------- /packages/darwin-arm64/scripts/hydrate-symlinks.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs/promises'; 2 | import path from 'path'; 3 | 4 | const symlinkFile = path.join(process.cwd(), 'native', 'pg-symlinks.json'); 5 | const originalWorkingDirectory = process.cwd(); 6 | 7 | /** 8 | * This function will optionally read symlinks from `pg-symlinks.json` and 9 | * rehydrate them. 10 | */ 11 | async function hydrateSymlinks() { 12 | // Retrieve the symlinks 13 | /** @type {{ source: string, target: string }[]} */ 14 | const symlinks = await fs.readFile(symlinkFile, { encoding: 'utf-8' }) 15 | .then(JSON.parse) 16 | .catch(() => ([])); 17 | 18 | // Re-hydrate all of them 19 | for (let { source, target } of symlinks) { 20 | // Make sure all symlinks are relative to the directory they are in, so 21 | // that when whole directories are moved, the symlinks don't break as easily. 22 | const dirname = path.dirname(source); 23 | const relSource = path.relative(dirname, source); 24 | const relTarget = path.relative(dirname, target); 25 | 26 | // To make this work, we need to change the working directory for NodeJS 27 | process.chdir(dirname); 28 | 29 | try { 30 | // We can then create the symlink 31 | await fs.symlink(relSource, relTarget); 32 | } catch { 33 | // Swallow any errors, such as files already existing 34 | } 35 | 36 | // And switch back to the original working directory 37 | process.chdir(originalWorkingDirectory); 38 | } 39 | } 40 | 41 | hydrateSymlinks(); -------------------------------------------------------------------------------- /packages/darwin-x64/scripts/hydrate-symlinks.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs/promises'; 2 | import path from 'path'; 3 | 4 | const symlinkFile = path.join(process.cwd(), 'native', 'pg-symlinks.json'); 5 | const originalWorkingDirectory = process.cwd(); 6 | 7 | /** 8 | * This function will optionally read symlinks from `pg-symlinks.json` and 9 | * rehydrate them. 10 | */ 11 | async function hydrateSymlinks() { 12 | // Retrieve the symlinks 13 | /** @type {{ source: string, target: string }[]} */ 14 | const symlinks = await fs.readFile(symlinkFile, { encoding: 'utf-8' }) 15 | .then(JSON.parse) 16 | .catch(() => ([])); 17 | 18 | // Re-hydrate all of them 19 | for (let { source, target } of symlinks) { 20 | // Make sure all symlinks are relative to the directory they are in, so 21 | // that when whole directories are moved, the symlinks don't break as easily. 22 | const dirname = path.dirname(source); 23 | const relSource = path.relative(dirname, source); 24 | const relTarget = path.relative(dirname, target); 25 | 26 | // To make this work, we need to change the working directory for NodeJS 27 | process.chdir(dirname); 28 | 29 | try { 30 | // We can then create the symlink 31 | await fs.symlink(relSource, relTarget); 32 | } catch { 33 | // Swallow any errors, such as files already existing 34 | } 35 | 36 | // And switch back to the original working directory 37 | process.chdir(originalWorkingDirectory); 38 | } 39 | } 40 | 41 | hydrateSymlinks(); -------------------------------------------------------------------------------- /packages/linux-arm/scripts/hydrate-symlinks.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs/promises'; 2 | import path from 'path'; 3 | 4 | const symlinkFile = path.join(process.cwd(), 'native', 'pg-symlinks.json'); 5 | const originalWorkingDirectory = process.cwd(); 6 | 7 | /** 8 | * This function will optionally read symlinks from `pg-symlinks.json` and 9 | * rehydrate them. 10 | */ 11 | async function hydrateSymlinks() { 12 | // Retrieve the symlinks 13 | /** @type {{ source: string, target: string }[]} */ 14 | const symlinks = await fs.readFile(symlinkFile, { encoding: 'utf-8' }) 15 | .then(JSON.parse) 16 | .catch(() => ([])); 17 | 18 | // Re-hydrate all of them 19 | for (let { source, target } of symlinks) { 20 | // Make sure all symlinks are relative to the directory they are in, so 21 | // that when whole directories are moved, the symlinks don't break as easily. 22 | const dirname = path.dirname(source); 23 | const relSource = path.relative(dirname, source); 24 | const relTarget = path.relative(dirname, target); 25 | 26 | // To make this work, we need to change the working directory for NodeJS 27 | process.chdir(dirname); 28 | 29 | try { 30 | // We can then create the symlink 31 | await fs.symlink(relSource, relTarget); 32 | } catch { 33 | // Swallow any errors, such as files already existing 34 | } 35 | 36 | // And switch back to the original working directory 37 | process.chdir(originalWorkingDirectory); 38 | } 39 | } 40 | 41 | hydrateSymlinks(); -------------------------------------------------------------------------------- /packages/linux-arm64/scripts/hydrate-symlinks.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs/promises'; 2 | import path from 'path'; 3 | 4 | const symlinkFile = path.join(process.cwd(), 'native', 'pg-symlinks.json'); 5 | const originalWorkingDirectory = process.cwd(); 6 | 7 | /** 8 | * This function will optionally read symlinks from `pg-symlinks.json` and 9 | * rehydrate them. 10 | */ 11 | async function hydrateSymlinks() { 12 | // Retrieve the symlinks 13 | /** @type {{ source: string, target: string }[]} */ 14 | const symlinks = await fs.readFile(symlinkFile, { encoding: 'utf-8' }) 15 | .then(JSON.parse) 16 | .catch(() => ([])); 17 | 18 | // Re-hydrate all of them 19 | for (let { source, target } of symlinks) { 20 | // Make sure all symlinks are relative to the directory they are in, so 21 | // that when whole directories are moved, the symlinks don't break as easily. 22 | const dirname = path.dirname(source); 23 | const relSource = path.relative(dirname, source); 24 | const relTarget = path.relative(dirname, target); 25 | 26 | // To make this work, we need to change the working directory for NodeJS 27 | process.chdir(dirname); 28 | 29 | try { 30 | // We can then create the symlink 31 | await fs.symlink(relSource, relTarget); 32 | } catch { 33 | // Swallow any errors, such as files already existing 34 | } 35 | 36 | // And switch back to the original working directory 37 | process.chdir(originalWorkingDirectory); 38 | } 39 | } 40 | 41 | hydrateSymlinks(); -------------------------------------------------------------------------------- /packages/linux-ia32/scripts/hydrate-symlinks.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs/promises'; 2 | import path from 'path'; 3 | 4 | const symlinkFile = path.join(process.cwd(), 'native', 'pg-symlinks.json'); 5 | const originalWorkingDirectory = process.cwd(); 6 | 7 | /** 8 | * This function will optionally read symlinks from `pg-symlinks.json` and 9 | * rehydrate them. 10 | */ 11 | async function hydrateSymlinks() { 12 | // Retrieve the symlinks 13 | /** @type {{ source: string, target: string }[]} */ 14 | const symlinks = await fs.readFile(symlinkFile, { encoding: 'utf-8' }) 15 | .then(JSON.parse) 16 | .catch(() => ([])); 17 | 18 | // Re-hydrate all of them 19 | for (let { source, target } of symlinks) { 20 | // Make sure all symlinks are relative to the directory they are in, so 21 | // that when whole directories are moved, the symlinks don't break as easily. 22 | const dirname = path.dirname(source); 23 | const relSource = path.relative(dirname, source); 24 | const relTarget = path.relative(dirname, target); 25 | 26 | // To make this work, we need to change the working directory for NodeJS 27 | process.chdir(dirname); 28 | 29 | try { 30 | // We can then create the symlink 31 | await fs.symlink(relSource, relTarget); 32 | } catch { 33 | // Swallow any errors, such as files already existing 34 | } 35 | 36 | // And switch back to the original working directory 37 | process.chdir(originalWorkingDirectory); 38 | } 39 | } 40 | 41 | hydrateSymlinks(); -------------------------------------------------------------------------------- /packages/linux-ppc64/scripts/hydrate-symlinks.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs/promises'; 2 | import path from 'path'; 3 | 4 | const symlinkFile = path.join(process.cwd(), 'native', 'pg-symlinks.json'); 5 | const originalWorkingDirectory = process.cwd(); 6 | 7 | /** 8 | * This function will optionally read symlinks from `pg-symlinks.json` and 9 | * rehydrate them. 10 | */ 11 | async function hydrateSymlinks() { 12 | // Retrieve the symlinks 13 | /** @type {{ source: string, target: string }[]} */ 14 | const symlinks = await fs.readFile(symlinkFile, { encoding: 'utf-8' }) 15 | .then(JSON.parse) 16 | .catch(() => ([])); 17 | 18 | // Re-hydrate all of them 19 | for (let { source, target } of symlinks) { 20 | // Make sure all symlinks are relative to the directory they are in, so 21 | // that when whole directories are moved, the symlinks don't break as easily. 22 | const dirname = path.dirname(source); 23 | const relSource = path.relative(dirname, source); 24 | const relTarget = path.relative(dirname, target); 25 | 26 | // To make this work, we need to change the working directory for NodeJS 27 | process.chdir(dirname); 28 | 29 | try { 30 | // We can then create the symlink 31 | await fs.symlink(relSource, relTarget); 32 | } catch { 33 | // Swallow any errors, such as files already existing 34 | } 35 | 36 | // And switch back to the original working directory 37 | process.chdir(originalWorkingDirectory); 38 | } 39 | } 40 | 41 | hydrateSymlinks(); -------------------------------------------------------------------------------- /packages/linux-x64/scripts/hydrate-symlinks.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs/promises'; 2 | import path from 'path'; 3 | 4 | const symlinkFile = path.join(process.cwd(), 'native', 'pg-symlinks.json'); 5 | const originalWorkingDirectory = process.cwd(); 6 | 7 | /** 8 | * This function will optionally read symlinks from `pg-symlinks.json` and 9 | * rehydrate them. 10 | */ 11 | async function hydrateSymlinks() { 12 | // Retrieve the symlinks 13 | /** @type {{ source: string, target: string }[]} */ 14 | const symlinks = await fs.readFile(symlinkFile, { encoding: 'utf-8' }) 15 | .then(JSON.parse) 16 | .catch(() => ([])); 17 | 18 | // Re-hydrate all of them 19 | for (let { source, target } of symlinks) { 20 | // Make sure all symlinks are relative to the directory they are in, so 21 | // that when whole directories are moved, the symlinks don't break as easily. 22 | const dirname = path.dirname(source); 23 | const relSource = path.relative(dirname, source); 24 | const relTarget = path.relative(dirname, target); 25 | 26 | // To make this work, we need to change the working directory for NodeJS 27 | process.chdir(dirname); 28 | 29 | try { 30 | // We can then create the symlink 31 | await fs.symlink(relSource, relTarget); 32 | } catch { 33 | // Swallow any errors, such as files already existing 34 | } 35 | 36 | // And switch back to the original working directory 37 | process.chdir(originalWorkingDirectory); 38 | } 39 | } 40 | 41 | hydrateSymlinks(); -------------------------------------------------------------------------------- /packages/windows-x64/scripts/hydrate-symlinks.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs/promises'; 2 | import path from 'path'; 3 | 4 | const symlinkFile = path.join(process.cwd(), 'native', 'pg-symlinks.json'); 5 | const originalWorkingDirectory = process.cwd(); 6 | 7 | /** 8 | * This function will optionally read symlinks from `pg-symlinks.json` and 9 | * rehydrate them. 10 | */ 11 | async function hydrateSymlinks() { 12 | // Retrieve the symlinks 13 | /** @type {{ source: string, target: string }[]} */ 14 | const symlinks = await fs.readFile(symlinkFile, { encoding: 'utf-8' }) 15 | .then(JSON.parse) 16 | .catch(() => ([])); 17 | 18 | // Re-hydrate all of them 19 | for (let { source, target } of symlinks) { 20 | // Make sure all symlinks are relative to the directory they are in, so 21 | // that when whole directories are moved, the symlinks don't break as easily. 22 | const dirname = path.dirname(source); 23 | const relSource = path.relative(dirname, source); 24 | const relTarget = path.relative(dirname, target); 25 | 26 | // To make this work, we need to change the working directory for NodeJS 27 | process.chdir(dirname); 28 | 29 | try { 30 | // We can then create the symlink 31 | await fs.symlink(relSource, relTarget); 32 | } catch { 33 | // Swallow any errors, such as files already existing 34 | } 35 | 36 | // And switch back to the original working directory 37 | process.chdir(originalWorkingDirectory); 38 | } 39 | } 40 | 41 | hydrateSymlinks(); -------------------------------------------------------------------------------- /packages/embedded-postgres/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "embedded-postgres", 3 | "version": "18.1.0-beta.15", 4 | "description": "A package to run an embedded Postgresql database right from NodeJS", 5 | "exports": "./dist/index.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/leinelissen/embedded-postgres" 9 | }, 10 | "type": "module", 11 | "scripts": { 12 | "start": "tsc -w", 13 | "build": "tsc", 14 | "lint": "eslint ./src --ext ts", 15 | "docs": "typedoc --plugin typedoc-plugin-markdown ./src/types.ts --theme markdown --excludePrivate", 16 | "test": "vitest" 17 | }, 18 | "keywords": [ 19 | "postgres", 20 | "postgresql", 21 | "database", 22 | "embedded" 23 | ], 24 | "author": "Lei Nelissen", 25 | "license": "MIT", 26 | "devDependencies": { 27 | "@embedded-postgres/symlink-reader": "^18.1.0-beta.15", 28 | "@types/async-exit-hook": "^2.0.0", 29 | "@types/pg": "^8.6.5", 30 | "eslint": "^8.56.0", 31 | "typescript": "^4.7.3", 32 | "vitest": "^1.1.0" 33 | }, 34 | "optionalDependencies": { 35 | "@embedded-postgres/darwin-arm64": "^18.1.0-beta.15", 36 | "@embedded-postgres/darwin-x64": "^18.1.0-beta.15", 37 | "@embedded-postgres/linux-arm": "^18.1.0-beta.15", 38 | "@embedded-postgres/linux-arm64": "^18.1.0-beta.15", 39 | "@embedded-postgres/linux-ia32": "^18.1.0-beta.15", 40 | "@embedded-postgres/linux-ppc64": "^18.1.0-beta.15", 41 | "@embedded-postgres/linux-x64": "^18.1.0-beta.15", 42 | "@embedded-postgres/windows-x64": "^18.1.0-beta.15" 43 | }, 44 | "dependencies": { 45 | "async-exit-hook": "^2.0.1", 46 | "pg": "^8.7.3" 47 | }, 48 | "publishConfig": { 49 | "access": "public" 50 | }, 51 | "files": [ 52 | "/dist/**/*", 53 | "README.md" 54 | ], 55 | "engines": { 56 | "node": ">=16" 57 | }, 58 | "gitHead": "5b3e39624b6a9a1e3d53404684ee1239efa19020" 59 | } 60 | -------------------------------------------------------------------------------- /packages/embedded-postgres/src/binary.ts: -------------------------------------------------------------------------------- 1 | import os from 'os'; 2 | 3 | export type PostgresBinaries = { 4 | postgres: string; 5 | pg_ctl: string; 6 | initdb: string; 7 | } 8 | 9 | function getBinaries(): Promise { 10 | const arch = os.arch(); 11 | const platform = os.platform(); 12 | 13 | switch (platform) { 14 | case 'darwin': 15 | switch(arch) { 16 | case 'arm64': 17 | return import('@embedded-postgres/darwin-arm64'); 18 | case 'x64': 19 | return import('@embedded-postgres/darwin-x64'); 20 | default: 21 | throw new Error(`Unsupported arch "${arch}" for platform "${platform}"`); 22 | } 23 | case 'linux': 24 | switch(arch) { 25 | case 'arm64': 26 | return import('@embedded-postgres/linux-arm64'); 27 | case 'arm': 28 | return import('@embedded-postgres/linux-arm'); 29 | case 'ia32': 30 | return import('@embedded-postgres/linux-ia32'); 31 | case 'ppc64': 32 | return import('@embedded-postgres/linux-ppc64'); 33 | case 'x64': 34 | return import('@embedded-postgres/linux-x64'); 35 | default: 36 | throw new Error(`Unsupported arch "${arch}" for platform "${platform}"`); 37 | } 38 | case 'win32': 39 | switch(arch) { 40 | case 'x64': 41 | return import('@embedded-postgres/windows-x64'); 42 | default: 43 | throw new Error(`Unsupported arch "${arch}" for platform "${platform}"`); 44 | } 45 | default: 46 | throw new Error(`Unsupported platform "${platform}"`); 47 | } 48 | } 49 | 50 | export default getBinaries; -------------------------------------------------------------------------------- /scripts/release-new-version.js: -------------------------------------------------------------------------------- 1 | import lernaRun from '@lerna/run'; 2 | import lernaVersion from '@lerna/version'; 3 | import lernaPublish from '@lerna/publish'; 4 | 5 | /** 6 | * Define a static set of versions that are supported. This means that only new 7 | * binaries for thesse versions will be released. 8 | */ 9 | const supportedVersions = [ 10 | '13.23.0', 11 | '14.20.0', 12 | '15.15.0', 13 | '16.11.0', 14 | '17.7.0', 15 | '18.1.0', 16 | ]; 17 | 18 | /** 19 | * Accept a particular affix that should appended to the version number. The 20 | * affix will be automatically prefixed with `-` 21 | */ 22 | const affix = process.argv[2] ? `-${process.argv[2]}` : ''; 23 | 24 | /** 25 | * Main executor function 26 | */ 27 | async function main() { 28 | // Loop through each supported version 29 | for await (let pgVersion of supportedVersions) { 30 | // Create version number from pgVersion and affix 31 | const version = `${pgVersion}${affix}`; 32 | const [major, minor, patch] = pgVersion.split('.'); 33 | 34 | // Log start 35 | console.log(`🔄 Processing v${version}...`); 36 | 37 | // Determine which packages should be ignored 38 | const ignore = major < 14 ? '@embedded-postgres/darwin-arm64' : ''; 39 | 40 | // Compile the scripts in all repositories 41 | await lernaRun({ 42 | cwd: process.cwd(), 43 | script: 'build', 44 | ignore, 45 | }); 46 | 47 | // Download the new versions in all repositories 48 | await lernaRun({ 49 | cwd: process.cwd(), 50 | script: 'download', 51 | '--': [pgVersion, '--', '--all'], 52 | ignore, 53 | }); 54 | 55 | // Release the newly downloaded releases 56 | await lernaVersion({ 57 | cwd: process.cwd(), 58 | bump: version, 59 | yes: true, 60 | forcePublish: true, 61 | ignore, 62 | }); 63 | 64 | // Publish the packages 65 | await lernaPublish({ 66 | cwd: process.cwd(), 67 | bump: 'from-package', 68 | yes: true, 69 | ignore, 70 | }); 71 | 72 | // Log success 73 | console.log(`✅ Processing v${version} complete.`) 74 | } 75 | } 76 | 77 | main(); 78 | -------------------------------------------------------------------------------- /packages/embedded-postgres/src/types.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * The options that are optionally specified for launching the Postgres database. 3 | */ 4 | export interface PostgresOptions { 5 | /** The location where the data should be persisted to. Defaults to: `./data/db` */ 6 | databaseDir: string; 7 | /** The port where the Postgres database should be listening. Defaults to: 8 | * `5432` */ 9 | port: number; 10 | /** The username for logging into the Postgres database. Defaults to `postgres` */ 11 | user: string; 12 | /** The password for logging into the Postgres database. Defaults to `password` */ 13 | password: string; 14 | /** The authentication method to use when authenticating against Postgres. 15 | * Defaults to `password` */ 16 | authMethod: 'scram-sha-256' | 'password' | 'md5'; 17 | /** Whether all data should be left in place when the database is shut down. 18 | * Defaults to `true`. */ 19 | persistent: boolean; 20 | /** Pass any additional flags to the initdb process. You can find all 21 | * available flags here: 22 | * https://www.postgresql.org/docs/current/app-initdb.html. Flags should be 23 | * passed as a string array, e.g. `["--debug"]` or `["--locale=en-GB"]` 24 | * 25 | * Defaults to `[]` 26 | */ 27 | initdbFlags: string[]; 28 | /** Pass any additional flags to the postgres process. You can find all 29 | * available flags here: 30 | * https://www.postgresql.org/docs/current/app-postgres.html. Flags should 31 | * be passed as a string array, e.g. `["--debug"]` or `["--locale=en-GB"]`. 32 | * 33 | * Defaults to `[]`. */ 34 | postgresFlags: string[]; 35 | /** 36 | * Postgres does not allow binaries to be run by root. In case you're 37 | * running in root-only enviroments, such as Docker containers, you may need 38 | * to create an extra user on your system in order to be able to call the binaries. 39 | * 40 | * NOTE: This WILL irreversibly modify your host system. The effects are 41 | * somewhat minor, but it's still recommend to only use this in Docker containers. 42 | * 43 | * Defaults to `false`. 44 | */ 45 | createPostgresUser: boolean; 46 | /** Pass in a custom logging handler. This will relay and console messages 47 | * that are generated by the postgres and initdb processes. Defaults to 48 | * `console.log` */ 49 | onLog: (message: string) => void; 50 | /** Pass in a custom error logging handler. This will catch and stderr 51 | * results coming in from the postgres and initdb processes. Defaults to 52 | * `console.error` */ 53 | onError: (messageOrError: string | Error | unknown) => void; 54 | } 55 | -------------------------------------------------------------------------------- /packages/linux-arm/README.md: -------------------------------------------------------------------------------- 1 | ![Embedded Postgres](https://github.com/leinelissen/embedded-postgres/raw/main/docs/images/embedded-postgres-header.svg) 2 | 3 |
4 | 5 | ![npm](https://img.shields.io/npm/v/@embedded-postgres/linux-arm) 6 | ![npm type definitions](https://img.shields.io/npm/types/@embedded-postgres/linux-arm) 7 | ![npm](https://img.shields.io/npm/dy/@embedded-postgres/linux-arm) 8 | ![NPM](https://img.shields.io/npm/l/@embedded-postgres/linux-arm) 9 | ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/leinelissen/embedded-postgres/test.yml) 10 | 11 |
12 | 13 |

14 | 🐘 A Node package that spawns PostgresQL clusters programatically. 15 |

16 | 17 | This package contains the `linux-arm` Postgres binaries for use with the `embedded-postgres` 18 | package. See 19 | [embedded-postgres](https://github.com/leinelissen/embedded-postgres) for a more 20 | developer-friendly way of spawning PostgresQL clusters. 21 | 22 | ## Installation 23 | `embedded-postgres` is available from NPM: 24 | 25 | ```sh 26 | npm i embedded-postgres 27 | ``` 28 | 29 |
30 | 31 | ## Using just the binaries 32 | If you just want to use the binaries, you can also just use this package 33 | directly. It exports the paths to the 34 | [`pg_ctl`](https://www.postgresql.org/docs/current/app-pg-ctl.html), 35 | [`initdb`](https://www.postgresql.org/docs/current/app-initdb.html) and 36 | [`postgres`](https://www.postgresql.org/docs/current/app-postgres.html) binaries 37 | for `linux-arm`. 38 | 39 | ```sh 40 | npm i @embedded-postgres/linux-arm 41 | ``` 42 | 43 | 44 | Follow the documentation to discover how to interface with the binaries. Any implementation is going to look something like this: 45 | ```ts 46 | import { pg_ctl, initdb, postgres } from '@embedded-postgres/linux-arm' 47 | import { execSync, spawn } from 'child_process'; 48 | 49 | execSync(initdb); 50 | spawn(postgres); 51 | ``` 52 | 53 | > [!IMPORTANT] 54 | > A more friendly wrapper for using these binaries is provided as the 55 | > [embedded-postgres](https://github.com/leinelissen/embedded-postgres) package. 56 | > Please use it if you're confused by the binaries. 57 | 58 | ## Credits and Licensing 59 | Embedded Postgres was created by Lei Nelissen for [BMD 60 | Studio](https://bmd.studio). It is based on [zonky's 61 | embedded-postgres-binaries](https://github.com/zonkyio/embedded-postgres). The 62 | binaries are made available under the Apache License 2.0, whereas the specific 63 | code in this package is made available under the MIT license. 64 | 65 | 66 | BMD Studio 67 | 68 | 69 |
70 | -------------------------------------------------------------------------------- /packages/linux-x64/README.md: -------------------------------------------------------------------------------- 1 | ![Embedded Postgres](https://github.com/leinelissen/embedded-postgres/raw/main/docs/images/embedded-postgres-header.svg) 2 | 3 |
4 | 5 | ![npm](https://img.shields.io/npm/v/@embedded-postgres/linux-x64) 6 | ![npm type definitions](https://img.shields.io/npm/types/@embedded-postgres/linux-x64) 7 | ![npm](https://img.shields.io/npm/dy/@embedded-postgres/linux-x64) 8 | ![NPM](https://img.shields.io/npm/l/@embedded-postgres/linux-x64) 9 | ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/leinelissen/embedded-postgres/test.yml) 10 | 11 |
12 | 13 |

14 | 🐘 A Node package that spawns PostgresQL clusters programatically. 15 |

16 | 17 | This package contains the `linux-x64` Postgres binaries for use with the `embedded-postgres` 18 | package. See 19 | [embedded-postgres](https://github.com/leinelissen/embedded-postgres) for a more 20 | developer-friendly way of spawning PostgresQL clusters. 21 | 22 | ## Installation 23 | `embedded-postgres` is available from NPM: 24 | 25 | ```sh 26 | npm i embedded-postgres 27 | ``` 28 | 29 |
30 | 31 | ## Using just the binaries 32 | If you just want to use the binaries, you can also just use this package 33 | directly. It exports the paths to the 34 | [`pg_ctl`](https://www.postgresql.org/docs/current/app-pg-ctl.html), 35 | [`initdb`](https://www.postgresql.org/docs/current/app-initdb.html) and 36 | [`postgres`](https://www.postgresql.org/docs/current/app-postgres.html) binaries 37 | for `linux-x64`. 38 | 39 | ```sh 40 | npm i @embedded-postgres/linux-x64 41 | ``` 42 | 43 | 44 | Follow the documentation to discover how to interface with the binaries. Any implementation is going to look something like this: 45 | ```ts 46 | import { pg_ctl, initdb, postgres } from '@embedded-postgres/linux-x64' 47 | import { execSync, spawn } from 'child_process'; 48 | 49 | execSync(initdb); 50 | spawn(postgres); 51 | ``` 52 | 53 | > [!IMPORTANT] 54 | > A more friendly wrapper for using these binaries is provided as the 55 | > [embedded-postgres](https://github.com/leinelissen/embedded-postgres) package. 56 | > Please use it if you're confused by the binaries. 57 | 58 | ## Credits and Licensing 59 | Embedded Postgres was created by Lei Nelissen for [BMD 60 | Studio](https://bmd.studio). It is based on [zonky's 61 | embedded-postgres-binaries](https://github.com/zonkyio/embedded-postgres). The 62 | binaries are made available under the Apache License 2.0, whereas the specific 63 | code in this package is made available under the MIT license. 64 | 65 | 66 | BMD Studio 67 | 68 | 69 |
70 | -------------------------------------------------------------------------------- /packages/darwin-x64/README.md: -------------------------------------------------------------------------------- 1 | ![Embedded Postgres](https://github.com/leinelissen/embedded-postgres/raw/main/docs/images/embedded-postgres-header.svg) 2 | 3 |
4 | 5 | ![npm](https://img.shields.io/npm/v/@embedded-postgres/darwin-x64) 6 | ![npm type definitions](https://img.shields.io/npm/types/@embedded-postgres/darwin-x64) 7 | ![npm](https://img.shields.io/npm/dy/@embedded-postgres/darwin-x64) 8 | ![NPM](https://img.shields.io/npm/l/@embedded-postgres/darwin-x64) 9 | ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/leinelissen/embedded-postgres/test.yml) 10 | 11 |
12 | 13 |

14 | 🐘 A Node package that spawns PostgresQL clusters programatically. 15 |

16 | 17 | This package contains the `darwin-x64` Postgres binaries for use with the `embedded-postgres` 18 | package. See 19 | [embedded-postgres](https://github.com/leinelissen/embedded-postgres) for a more 20 | developer-friendly way of spawning PostgresQL clusters. 21 | 22 | ## Installation 23 | `embedded-postgres` is available from NPM: 24 | 25 | ```sh 26 | npm i embedded-postgres 27 | ``` 28 | 29 |
30 | 31 | ## Using just the binaries 32 | If you just want to use the binaries, you can also just use this package 33 | directly. It exports the paths to the 34 | [`pg_ctl`](https://www.postgresql.org/docs/current/app-pg-ctl.html), 35 | [`initdb`](https://www.postgresql.org/docs/current/app-initdb.html) and 36 | [`postgres`](https://www.postgresql.org/docs/current/app-postgres.html) binaries 37 | for `darwin-x64`. 38 | 39 | ```sh 40 | npm i @embedded-postgres/darwin-x64 41 | ``` 42 | 43 | 44 | Follow the documentation to discover how to interface with the binaries. Any implementation is going to look something like this: 45 | ```ts 46 | import { pg_ctl, initdb, postgres } from '@embedded-postgres/darwin-x64' 47 | import { execSync, spawn } from 'child_process'; 48 | 49 | execSync(initdb); 50 | spawn(postgres); 51 | ``` 52 | 53 | > [!IMPORTANT] 54 | > A more friendly wrapper for using these binaries is provided as the 55 | > [embedded-postgres](https://github.com/leinelissen/embedded-postgres) package. 56 | > Please use it if you're confused by the binaries. 57 | 58 | ## Credits and Licensing 59 | Embedded Postgres was created by Lei Nelissen for [BMD 60 | Studio](https://bmd.studio). It is based on [zonky's 61 | embedded-postgres-binaries](https://github.com/zonkyio/embedded-postgres). The 62 | binaries are made available under the Apache License 2.0, whereas the specific 63 | code in this package is made available under the MIT license. 64 | 65 | 66 | BMD Studio 67 | 68 | 69 |
70 | -------------------------------------------------------------------------------- /packages/linux-ia32/README.md: -------------------------------------------------------------------------------- 1 | ![Embedded Postgres](https://github.com/leinelissen/embedded-postgres/raw/main/docs/images/embedded-postgres-header.svg) 2 | 3 |
4 | 5 | ![npm](https://img.shields.io/npm/v/@embedded-postgres/linux-ia32) 6 | ![npm type definitions](https://img.shields.io/npm/types/@embedded-postgres/linux-ia32) 7 | ![npm](https://img.shields.io/npm/dy/@embedded-postgres/linux-ia32) 8 | ![NPM](https://img.shields.io/npm/l/@embedded-postgres/linux-ia32) 9 | ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/leinelissen/embedded-postgres/test.yml) 10 | 11 |
12 | 13 |

14 | 🐘 A Node package that spawns PostgresQL clusters programatically. 15 |

16 | 17 | This package contains the `linux-ia32` Postgres binaries for use with the `embedded-postgres` 18 | package. See 19 | [embedded-postgres](https://github.com/leinelissen/embedded-postgres) for a more 20 | developer-friendly way of spawning PostgresQL clusters. 21 | 22 | ## Installation 23 | `embedded-postgres` is available from NPM: 24 | 25 | ```sh 26 | npm i embedded-postgres 27 | ``` 28 | 29 |
30 | 31 | ## Using just the binaries 32 | If you just want to use the binaries, you can also just use this package 33 | directly. It exports the paths to the 34 | [`pg_ctl`](https://www.postgresql.org/docs/current/app-pg-ctl.html), 35 | [`initdb`](https://www.postgresql.org/docs/current/app-initdb.html) and 36 | [`postgres`](https://www.postgresql.org/docs/current/app-postgres.html) binaries 37 | for `linux-ia32`. 38 | 39 | ```sh 40 | npm i @embedded-postgres/linux-ia32 41 | ``` 42 | 43 | 44 | Follow the documentation to discover how to interface with the binaries. Any implementation is going to look something like this: 45 | ```ts 46 | import { pg_ctl, initdb, postgres } from '@embedded-postgres/linux-ia32' 47 | import { execSync, spawn } from 'child_process'; 48 | 49 | execSync(initdb); 50 | spawn(postgres); 51 | ``` 52 | 53 | > [!IMPORTANT] 54 | > A more friendly wrapper for using these binaries is provided as the 55 | > [embedded-postgres](https://github.com/leinelissen/embedded-postgres) package. 56 | > Please use it if you're confused by the binaries. 57 | 58 | ## Credits and Licensing 59 | Embedded Postgres was created by Lei Nelissen for [BMD 60 | Studio](https://bmd.studio). It is based on [zonky's 61 | embedded-postgres-binaries](https://github.com/zonkyio/embedded-postgres). The 62 | binaries are made available under the Apache License 2.0, whereas the specific 63 | code in this package is made available under the MIT license. 64 | 65 | 66 | BMD Studio 67 | 68 | 69 |
70 | -------------------------------------------------------------------------------- /packages/linux-arm64/README.md: -------------------------------------------------------------------------------- 1 | ![Embedded Postgres](https://github.com/leinelissen/embedded-postgres/raw/main/docs/images/embedded-postgres-header.svg) 2 | 3 |
4 | 5 | ![npm](https://img.shields.io/npm/v/@embedded-postgres/linux-arm64) 6 | ![npm type definitions](https://img.shields.io/npm/types/@embedded-postgres/linux-arm64) 7 | ![npm](https://img.shields.io/npm/dy/@embedded-postgres/linux-arm64) 8 | ![NPM](https://img.shields.io/npm/l/@embedded-postgres/linux-arm64) 9 | ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/leinelissen/embedded-postgres/test.yml) 10 | 11 |
12 | 13 |

14 | 🐘 A Node package that spawns PostgresQL clusters programatically. 15 |

16 | 17 | This package contains the `linux-arm64` Postgres binaries for use with the `embedded-postgres` 18 | package. See 19 | [embedded-postgres](https://github.com/leinelissen/embedded-postgres) for a more 20 | developer-friendly way of spawning PostgresQL clusters. 21 | 22 | ## Installation 23 | `embedded-postgres` is available from NPM: 24 | 25 | ```sh 26 | npm i embedded-postgres 27 | ``` 28 | 29 |
30 | 31 | ## Using just the binaries 32 | If you just want to use the binaries, you can also just use this package 33 | directly. It exports the paths to the 34 | [`pg_ctl`](https://www.postgresql.org/docs/current/app-pg-ctl.html), 35 | [`initdb`](https://www.postgresql.org/docs/current/app-initdb.html) and 36 | [`postgres`](https://www.postgresql.org/docs/current/app-postgres.html) binaries 37 | for `linux-arm64`. 38 | 39 | ```sh 40 | npm i @embedded-postgres/linux-arm64 41 | ``` 42 | 43 | 44 | Follow the documentation to discover how to interface with the binaries. Any implementation is going to look something like this: 45 | ```ts 46 | import { pg_ctl, initdb, postgres } from '@embedded-postgres/linux-arm64' 47 | import { execSync, spawn } from 'child_process'; 48 | 49 | execSync(initdb); 50 | spawn(postgres); 51 | ``` 52 | 53 | > [!IMPORTANT] 54 | > A more friendly wrapper for using these binaries is provided as the 55 | > [embedded-postgres](https://github.com/leinelissen/embedded-postgres) package. 56 | > Please use it if you're confused by the binaries. 57 | 58 | ## Credits and Licensing 59 | Embedded Postgres was created by Lei Nelissen for [BMD 60 | Studio](https://bmd.studio). It is based on [zonky's 61 | embedded-postgres-binaries](https://github.com/zonkyio/embedded-postgres). The 62 | binaries are made available under the Apache License 2.0, whereas the specific 63 | code in this package is made available under the MIT license. 64 | 65 | 66 | BMD Studio 67 | 68 | 69 |
70 | -------------------------------------------------------------------------------- /packages/linux-ppc64/README.md: -------------------------------------------------------------------------------- 1 | ![Embedded Postgres](https://github.com/leinelissen/embedded-postgres/raw/main/docs/images/embedded-postgres-header.svg) 2 | 3 |
4 | 5 | ![npm](https://img.shields.io/npm/v/@embedded-postgres/linux-ppc64) 6 | ![npm type definitions](https://img.shields.io/npm/types/@embedded-postgres/linux-ppc64) 7 | ![npm](https://img.shields.io/npm/dy/@embedded-postgres/linux-ppc64) 8 | ![NPM](https://img.shields.io/npm/l/@embedded-postgres/linux-ppc64) 9 | ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/leinelissen/embedded-postgres/test.yml) 10 | 11 |
12 | 13 |

14 | 🐘 A Node package that spawns PostgresQL clusters programatically. 15 |

16 | 17 | This package contains the `linux-ppc64` Postgres binaries for use with the `embedded-postgres` 18 | package. See 19 | [embedded-postgres](https://github.com/leinelissen/embedded-postgres) for a more 20 | developer-friendly way of spawning PostgresQL clusters. 21 | 22 | ## Installation 23 | `embedded-postgres` is available from NPM: 24 | 25 | ```sh 26 | npm i embedded-postgres 27 | ``` 28 | 29 |
30 | 31 | ## Using just the binaries 32 | If you just want to use the binaries, you can also just use this package 33 | directly. It exports the paths to the 34 | [`pg_ctl`](https://www.postgresql.org/docs/current/app-pg-ctl.html), 35 | [`initdb`](https://www.postgresql.org/docs/current/app-initdb.html) and 36 | [`postgres`](https://www.postgresql.org/docs/current/app-postgres.html) binaries 37 | for `linux-ppc64`. 38 | 39 | ```sh 40 | npm i @embedded-postgres/linux-ppc64 41 | ``` 42 | 43 | 44 | Follow the documentation to discover how to interface with the binaries. Any implementation is going to look something like this: 45 | ```ts 46 | import { pg_ctl, initdb, postgres } from '@embedded-postgres/linux-ppc64' 47 | import { execSync, spawn } from 'child_process'; 48 | 49 | execSync(initdb); 50 | spawn(postgres); 51 | ``` 52 | 53 | > [!IMPORTANT] 54 | > A more friendly wrapper for using these binaries is provided as the 55 | > [embedded-postgres](https://github.com/leinelissen/embedded-postgres) package. 56 | > Please use it if you're confused by the binaries. 57 | 58 | ## Credits and Licensing 59 | Embedded Postgres was created by Lei Nelissen for [BMD 60 | Studio](https://bmd.studio). It is based on [zonky's 61 | embedded-postgres-binaries](https://github.com/zonkyio/embedded-postgres). The 62 | binaries are made available under the Apache License 2.0, whereas the specific 63 | code in this package is made available under the MIT license. 64 | 65 | 66 | BMD Studio 67 | 68 | 69 |
70 | -------------------------------------------------------------------------------- /packages/windows-x64/README.md: -------------------------------------------------------------------------------- 1 | ![Embedded Postgres](https://github.com/leinelissen/embedded-postgres/raw/main/docs/images/embedded-postgres-header.svg) 2 | 3 |
4 | 5 | ![npm](https://img.shields.io/npm/v/@embedded-postgres/windows-x64) 6 | ![npm type definitions](https://img.shields.io/npm/types/@embedded-postgres/windows-x64) 7 | ![npm](https://img.shields.io/npm/dy/@embedded-postgres/windows-x64) 8 | ![NPM](https://img.shields.io/npm/l/@embedded-postgres/windows-x64) 9 | ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/leinelissen/embedded-postgres/test.yml) 10 | 11 |
12 | 13 |

14 | 🐘 A Node package that spawns PostgresQL clusters programatically. 15 |

16 | 17 | This package contains the `windows-x64` Postgres binaries for use with the `embedded-postgres` 18 | package. See 19 | [embedded-postgres](https://github.com/leinelissen/embedded-postgres) for a more 20 | developer-friendly way of spawning PostgresQL clusters. 21 | 22 | ## Installation 23 | `embedded-postgres` is available from NPM: 24 | 25 | ```sh 26 | npm i embedded-postgres 27 | ``` 28 | 29 |
30 | 31 | ## Using just the binaries 32 | If you just want to use the binaries, you can also just use this package 33 | directly. It exports the paths to the 34 | [`pg_ctl`](https://www.postgresql.org/docs/current/app-pg-ctl.html), 35 | [`initdb`](https://www.postgresql.org/docs/current/app-initdb.html) and 36 | [`postgres`](https://www.postgresql.org/docs/current/app-postgres.html) binaries 37 | for `windows-x64`. 38 | 39 | ```sh 40 | npm i @embedded-postgres/windows-x64 41 | ``` 42 | 43 | 44 | Follow the documentation to discover how to interface with the binaries. Any implementation is going to look something like this: 45 | ```ts 46 | import { pg_ctl, initdb, postgres } from '@embedded-postgres/windows-x64' 47 | import { execSync, spawn } from 'child_process'; 48 | 49 | execSync(initdb); 50 | spawn(postgres); 51 | ``` 52 | 53 | > [!IMPORTANT] 54 | > A more friendly wrapper for using these binaries is provided as the 55 | > [embedded-postgres](https://github.com/leinelissen/embedded-postgres) package. 56 | > Please use it if you're confused by the binaries. 57 | 58 | ## Credits and Licensing 59 | Embedded Postgres was created by Lei Nelissen for [BMD 60 | Studio](https://bmd.studio). It is based on [zonky's 61 | embedded-postgres-binaries](https://github.com/zonkyio/embedded-postgres). The 62 | binaries are made available under the Apache License 2.0, whereas the specific 63 | code in this package is made available under the MIT license. 64 | 65 | 66 | BMD Studio 67 | 68 | 69 |
70 | -------------------------------------------------------------------------------- /packages/darwin-arm64/README.md: -------------------------------------------------------------------------------- 1 | ![Embedded Postgres](https://github.com/leinelissen/embedded-postgres/raw/main/docs/images/embedded-postgres-header.svg) 2 | 3 |
4 | 5 | ![npm](https://img.shields.io/npm/v/@embedded-postgres/darwin-arm64) 6 | ![npm type definitions](https://img.shields.io/npm/types/@embedded-postgres/darwin-arm64) 7 | ![npm](https://img.shields.io/npm/dy/@embedded-postgres/darwin-arm64) 8 | ![NPM](https://img.shields.io/npm/l/@embedded-postgres/darwin-arm64) 9 | ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/leinelissen/embedded-postgres/test.yml) 10 | 11 |
12 | 13 |

14 | 🐘 A Node package that spawns PostgresQL clusters programatically. 15 |

16 | 17 | This package contains the `darwin-arm64` Postgres binaries for use with the `embedded-postgres` 18 | package. See 19 | [embedded-postgres](https://github.com/leinelissen/embedded-postgres) for a more 20 | developer-friendly way of spawning PostgresQL clusters. 21 | 22 | ## Installation 23 | `embedded-postgres` is available from NPM: 24 | 25 | ```sh 26 | npm i embedded-postgres 27 | ``` 28 | 29 |
30 | 31 | ## Using just the binaries 32 | If you just want to use the binaries, you can also just use this package 33 | directly. It exports the paths to the 34 | [`pg_ctl`](https://www.postgresql.org/docs/current/app-pg-ctl.html), 35 | [`initdb`](https://www.postgresql.org/docs/current/app-initdb.html) and 36 | [`postgres`](https://www.postgresql.org/docs/current/app-postgres.html) binaries 37 | for `darwin-arm64`. 38 | 39 | ```sh 40 | npm i @embedded-postgres/darwin-arm64 41 | ``` 42 | 43 | 44 | Follow the documentation to discover how to interface with the binaries. Any implementation is going to look something like this: 45 | ```ts 46 | import { pg_ctl, initdb, postgres } from '@embedded-postgres/darwin-arm64' 47 | import { execSync, spawn } from 'child_process'; 48 | 49 | execSync(initdb); 50 | spawn(postgres); 51 | ``` 52 | 53 | > [!IMPORTANT] 54 | > A more friendly wrapper for using these binaries is provided as the 55 | > [embedded-postgres](https://github.com/leinelissen/embedded-postgres) package. 56 | > Please use it if you're confused by the binaries. 57 | 58 | ## Credits and Licensing 59 | Embedded Postgres was created by Lei Nelissen for [BMD 60 | Studio](https://bmd.studio). It is based on [zonky's 61 | embedded-postgres-binaries](https://github.com/zonkyio/embedded-postgres). The 62 | binaries are made available under the Apache License 2.0, whereas the specific 63 | code in this package is made available under the MIT license. 64 | 65 | 66 | BMD Studio 67 | 68 | 69 |
70 | -------------------------------------------------------------------------------- /packages/symlink-reader/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Dirent } from 'fs'; 2 | import fs from 'fs/promises'; 3 | import path from 'path'; 4 | 5 | const binaryDirectory = path.join(process.cwd(), 'native'); 6 | export const symlinkFile = path.join(binaryDirectory, 'pg-symlinks.json'); 7 | 8 | // A tuple that contains an entry and its path relative to a base directory 9 | type EntryTuple = { entryPath: string; entry: Dirent }; 10 | 11 | /** 12 | * Recursively read all files in a directory, returning not only the names but 13 | * the Dirents as well. 14 | */ 15 | async function deepRead(directory: string) { 16 | // Retrieve all files in given directory 17 | const entries = await fs.readdir(directory, { withFileTypes: true }); 18 | 19 | // Loop through all files 20 | const paths = await Promise.all(entries.map(async (entry): Promise => { 21 | // Combine any received prefixes with the entry name 22 | const entryPath = path.join(directory, entry.name); 23 | 24 | // GUARD: Check if the file is a directory 25 | if (entry.isDirectory()) { 26 | // If so, we recurse based on the entry name, while also passing 27 | // along the path until now 28 | return deepRead(path.join(directory, entry.name)); 29 | } 30 | 31 | return { entryPath, entry }; 32 | })); 33 | 34 | // Return the flattened list 35 | return paths.flat(); 36 | } 37 | 38 | /** 39 | * This function will check for any symlinks in the /native folder of the 40 | * package that is calling it. It will then output a file called 41 | * `pg-symlinks.json` in said directory that contains all symlinks that were found. 42 | */ 43 | export async function readSymlinks(isNecessary: boolean) { 44 | if (!isNecessary) { 45 | return; 46 | } 47 | 48 | // First, pull all files out of the folder 49 | const entries = await deepRead(binaryDirectory); 50 | 51 | // Then retrieve all symlinks 52 | const symlinks = await Promise.all( 53 | entries.filter((e) => e.entry.isSymbolicLink()) 54 | // ... and map over them 55 | .map(async (tuple) => { 56 | // Find the source for the link 57 | const absoluteSource = await fs.realpath(tuple.entryPath); 58 | const source = path.relative(process.cwd(), absoluteSource); 59 | const target = path.relative(process.cwd(), tuple.entryPath); 60 | 61 | // Return a tuple that contains both source and target 62 | return { 63 | source, 64 | target, 65 | }; 66 | }) 67 | ); 68 | 69 | // Now, we only need to persist this file to disk! 70 | await fs.writeFile(symlinkFile, JSON.stringify(symlinks)); 71 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | .pnpm-debug.log* 9 | 10 | # Diagnostic reports (https://nodejs.org/api/report.html) 11 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 12 | 13 | # Runtime data 14 | pids 15 | *.pid 16 | *.seed 17 | *.pid.lock 18 | 19 | # Directory for instrumented libs generated by jscoverage/JSCover 20 | lib-cov 21 | 22 | # Coverage directory used by tools like istanbul 23 | coverage 24 | *.lcov 25 | 26 | # nyc test coverage 27 | .nyc_output 28 | 29 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 30 | .grunt 31 | 32 | # Bower dependency directory (https://bower.io/) 33 | bower_components 34 | 35 | # node-waf configuration 36 | .lock-wscript 37 | 38 | # Compiled binary addons (https://nodejs.org/api/addons.html) 39 | build/Release 40 | 41 | # Dependency directories 42 | node_modules/ 43 | jspm_packages/ 44 | 45 | # Snowpack dependency directory (https://snowpack.dev/) 46 | web_modules/ 47 | 48 | # TypeScript cache 49 | *.tsbuildinfo 50 | 51 | # Optional npm cache directory 52 | .npm 53 | 54 | # Optional eslint cache 55 | .eslintcache 56 | 57 | # Optional stylelint cache 58 | .stylelintcache 59 | 60 | # Microbundle cache 61 | .rpt2_cache/ 62 | .rts2_cache_cjs/ 63 | .rts2_cache_es/ 64 | .rts2_cache_umd/ 65 | 66 | # Optional REPL history 67 | .node_repl_history 68 | 69 | # Output of 'npm pack' 70 | *.tgz 71 | 72 | # Yarn Integrity file 73 | .yarn-integrity 74 | 75 | # dotenv environment variable files 76 | .env 77 | .env.development.local 78 | .env.test.local 79 | .env.production.local 80 | .env.local 81 | 82 | # parcel-bundler cache (https://parceljs.org/) 83 | .cache 84 | .parcel-cache 85 | 86 | # Next.js build output 87 | .next 88 | out 89 | 90 | # Nuxt.js build / generate output 91 | .nuxt 92 | dist 93 | 94 | # Gatsby files 95 | .cache/ 96 | # Comment in the public line in if your project uses Gatsby and not Next.js 97 | # https://nextjs.org/blog/next-9-1#public-directory-support 98 | # public 99 | 100 | # vuepress build output 101 | .vuepress/dist 102 | 103 | # vuepress v2.x temp and cache directory 104 | .temp 105 | .cache 106 | 107 | # Docusaurus cache and generated files 108 | .docusaurus 109 | 110 | # Serverless directories 111 | .serverless/ 112 | 113 | # FuseBox cache 114 | .fusebox/ 115 | 116 | # DynamoDB Local files 117 | .dynamodb/ 118 | 119 | # TernJS port file 120 | .tern-port 121 | 122 | # Stores VSCode versions used for testing VSCode extensions 123 | .vscode-test 124 | 125 | # yarn v2 126 | .yarn/cache 127 | .yarn/unplugged 128 | .yarn/build-state.yml 129 | .yarn/install-state.gz 130 | .pnp.* 131 | 132 | # Ignore natively downloaded files 133 | native 134 | native.txz 135 | 136 | .DS_Store -------------------------------------------------------------------------------- /packages/embedded-postgres/tests/index.test.ts: -------------------------------------------------------------------------------- 1 | import { it, expect, afterEach } from 'vitest'; 2 | import fs from 'fs/promises'; 3 | import path from 'path'; 4 | import EmbeddedPostgres from '../src/index.js'; 5 | import { PostgresOptions } from '../src/types.js'; 6 | import { beforeEach } from 'node:test'; 7 | 8 | const DB_NAME = 'embedded-pg-test-db'; 9 | const DB_PATH = path.join(__dirname, 'data', 'db'); 10 | 11 | const DEFAULT_SETTINGS: Partial = { 12 | port: 5433, 13 | databaseDir: DB_PATH, 14 | }; 15 | 16 | let pg: EmbeddedPostgres | undefined; 17 | 18 | beforeEach(async () => { 19 | // Reset the client 20 | pg = undefined; 21 | 22 | // 23 | }); 24 | 25 | afterEach(async () => { 26 | // Stop client 27 | await pg?.stop(); 28 | 29 | // Remove all cluster files 30 | await fs.rm(path.join(DB_PATH), { recursive: true, force: true }); 31 | }); 32 | 33 | it('should be able to initialise a cluster', async () => { 34 | // Initialise and stop a basic cluster 35 | pg = new EmbeddedPostgres(DEFAULT_SETTINGS); 36 | await pg.initialise(); 37 | 38 | // Check that the database files have been created 39 | const stat = await fs.stat( 40 | path.join(DB_PATH, 'pg_hba.conf') 41 | ); 42 | expect(stat.isFile()).toBe(true); 43 | }); 44 | 45 | it('should be able to start and stop a cluster', async () => { 46 | pg = new EmbeddedPostgres(DEFAULT_SETTINGS); 47 | await pg.initialise(); 48 | 49 | await pg.start(); 50 | }); 51 | 52 | // it('should throw an error if the cluster is attempted to be started without initialising', async () => { 53 | // pg = new EmbeddedPostgres(DEFAULT_SETTINGS); 54 | // try { 55 | // await pg.start(); 56 | // } catch (e) { 57 | // expect(e instanceof Error).toBe(true); 58 | // expect((e as Error).message).toBe('Cannot start cluster if it has not been initialised first.'); 59 | // } 60 | // }); 61 | 62 | it('should allow the creation of pg clients', async () => { 63 | // Initialise and start a basic cluster 64 | pg = new EmbeddedPostgres(DEFAULT_SETTINGS); 65 | await pg.initialise(); 66 | await pg.start(); 67 | 68 | // Create and connect a database client 69 | const client = pg.getPgClient(); 70 | await client.connect(); 71 | 72 | // Check if it can query the database 73 | const result = await client.query('SELECT datname FROM pg_database;'); 74 | expect(result.rows.map((r) => r.datname)).toContain('postgres'); 75 | }); 76 | 77 | it('should allow creating databases', async () => { 78 | // Initialise and start a basic cluster 79 | pg = new EmbeddedPostgres(DEFAULT_SETTINGS); 80 | await pg.initialise(); 81 | await pg.start(); 82 | 83 | // Create the database 84 | await pg.createDatabase(DB_NAME); 85 | 86 | // Connect the client 87 | const client = pg.getPgClient(); 88 | await client.connect(); 89 | 90 | // Retrieve database names and check whether the database has been created 91 | const result = await client.query('SELECT datname FROM pg_database;'); 92 | expect(result.rows.map((r) => r.datname)).toContain(DB_NAME); 93 | }); 94 | 95 | it('should allow deleting databases', async () => { 96 | // Initialise and start a basic cluster 97 | pg = new EmbeddedPostgres(DEFAULT_SETTINGS); 98 | await pg.initialise(); 99 | await pg.start(); 100 | 101 | // Create the database 102 | await pg.createDatabase(DB_NAME); 103 | 104 | // Connect the client 105 | const client = pg.getPgClient(); 106 | await client.connect(); 107 | 108 | // Retrieve database names and check whether the database has been created 109 | let result = await client.query('SELECT datname FROM pg_database;'); 110 | expect(result.rows.map((r) => r.datname)).toContain(DB_NAME); 111 | 112 | // Delete the database 113 | await pg.dropDatabase(DB_NAME); 114 | result = await client.query('SELECT datname FROM pg_database;'); 115 | expect(result.rows.map((r) => r.datname)).not.toContain(DB_NAME); 116 | }); 117 | 118 | it('should automatically remove files when persistent is set to false', async () => { 119 | // Initialise and start a basic cluster 120 | pg = new EmbeddedPostgres({ ...DEFAULT_SETTINGS, persistent: false }); 121 | await pg.initialise(); 122 | await pg.start(); 123 | 124 | // Check that the database files have been created 125 | const stat = await fs.stat( 126 | path.join(DB_PATH, 'pg_hba.conf') 127 | ); 128 | expect(stat.isFile()).toBe(true); 129 | 130 | // Auto-delete the database by stopping the cluster 131 | await pg.stop(); 132 | 133 | // Check that the database files have been delete 134 | expect(() => fs.stat(path.join(DB_PATH, 'pg_hba.conf'))) 135 | .rejects 136 | .toThrowError(); 137 | }); -------------------------------------------------------------------------------- /docs/images/logo-bmd.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/embedded-postgres/docs/interfaces/PostgresOptions.md: -------------------------------------------------------------------------------- 1 | [embedded-postgres](../README.md) / [Exports](../modules.md) / PostgresOptions 2 | 3 | # Interface: PostgresOptions 4 | 5 | The options that are optionally specified for launching the Postgres database. 6 | 7 | ## Table of contents 8 | 9 | ### Properties 10 | 11 | - [authMethod](PostgresOptions.md#authmethod) 12 | - [createPostgresUser](PostgresOptions.md#createpostgresuser) 13 | - [databaseDir](PostgresOptions.md#databasedir) 14 | - [initdbFlags](PostgresOptions.md#initdbflags) 15 | - [onError](PostgresOptions.md#onerror) 16 | - [onLog](PostgresOptions.md#onlog) 17 | - [password](PostgresOptions.md#password) 18 | - [persistent](PostgresOptions.md#persistent) 19 | - [port](PostgresOptions.md#port) 20 | - [postgresFlags](PostgresOptions.md#postgresflags) 21 | - [user](PostgresOptions.md#user) 22 | 23 | ## Properties 24 | 25 | ### authMethod 26 | 27 | • **authMethod**: ``"scram-sha-256"`` \| ``"password"`` \| ``"md5"`` 28 | 29 | The authentication method to use when authenticating against Postgres. 30 | Defaults to `password` 31 | 32 | #### Defined in 33 | 34 | [types.ts:16](https://github.com/leinelissen/embedded-postgres/blob/b9360f6/packages/embedded-postgres/src/types.ts#L16) 35 | 36 | ___ 37 | 38 | ### createPostgresUser 39 | 40 | • **createPostgresUser**: `boolean` 41 | 42 | Postgres does not allow binaries to be run by root. In case you're 43 | running in root-only enviroments, such as Docker containers, you may need 44 | to create an extra user on your system in order to be able to call the binaries. 45 | 46 | NOTE: This WILL irreversibly modify your host system. The effects are 47 | somewhat minor, but it's still recommend to only use this in Docker containers. 48 | 49 | Defaults to `false`. 50 | 51 | #### Defined in 52 | 53 | [types.ts:45](https://github.com/leinelissen/embedded-postgres/blob/b9360f6/packages/embedded-postgres/src/types.ts#L45) 54 | 55 | ___ 56 | 57 | ### databaseDir 58 | 59 | • **databaseDir**: `string` 60 | 61 | The location where the data should be persisted to. Defaults to: `./data/db` 62 | 63 | #### Defined in 64 | 65 | [types.ts:6](https://github.com/leinelissen/embedded-postgres/blob/b9360f6/packages/embedded-postgres/src/types.ts#L6) 66 | 67 | ___ 68 | 69 | ### initdbFlags 70 | 71 | • **initdbFlags**: `string`[] 72 | 73 | Pass any additional flags to the initdb process. You can find all 74 | available flags here: 75 | https://www.postgresql.org/docs/current/app-initdb.html. Flags should be 76 | passed as a string array, e.g. `["--debug"]` or `["--locale=en-GB"]` 77 | 78 | Defaults to `[]` 79 | 80 | #### Defined in 81 | 82 | [types.ts:27](https://github.com/leinelissen/embedded-postgres/blob/b9360f6/packages/embedded-postgres/src/types.ts#L27) 83 | 84 | ___ 85 | 86 | ### onError 87 | 88 | • **onError**: (`messageOrError`: `unknown`) => `void` 89 | 90 | #### Type declaration 91 | 92 | ▸ (`messageOrError`): `void` 93 | 94 | Pass in a custom error logging handler. This will catch and stderr 95 | results coming in from the postgres and initdb processes. Defaults to 96 | `console.error` 97 | 98 | ##### Parameters 99 | 100 | | Name | Type | 101 | | :------ | :------ | 102 | | `messageOrError` | `unknown` | 103 | 104 | ##### Returns 105 | 106 | `void` 107 | 108 | #### Defined in 109 | 110 | [types.ts:53](https://github.com/leinelissen/embedded-postgres/blob/b9360f6/packages/embedded-postgres/src/types.ts#L53) 111 | 112 | ___ 113 | 114 | ### onLog 115 | 116 | • **onLog**: (`message`: `string`) => `void` 117 | 118 | #### Type declaration 119 | 120 | ▸ (`message`): `void` 121 | 122 | Pass in a custom logging handler. This will relay and console messages 123 | that are generated by the postgres and initdb processes. Defaults to 124 | `console.log` 125 | 126 | ##### Parameters 127 | 128 | | Name | Type | 129 | | :------ | :------ | 130 | | `message` | `string` | 131 | 132 | ##### Returns 133 | 134 | `void` 135 | 136 | #### Defined in 137 | 138 | [types.ts:49](https://github.com/leinelissen/embedded-postgres/blob/b9360f6/packages/embedded-postgres/src/types.ts#L49) 139 | 140 | ___ 141 | 142 | ### password 143 | 144 | • **password**: `string` 145 | 146 | The password for logging into the Postgres database. Defaults to `password` 147 | 148 | #### Defined in 149 | 150 | [types.ts:13](https://github.com/leinelissen/embedded-postgres/blob/b9360f6/packages/embedded-postgres/src/types.ts#L13) 151 | 152 | ___ 153 | 154 | ### persistent 155 | 156 | • **persistent**: `boolean` 157 | 158 | Whether all data should be left in place when the database is shut down. 159 | Defaults to `true`. 160 | 161 | #### Defined in 162 | 163 | [types.ts:19](https://github.com/leinelissen/embedded-postgres/blob/b9360f6/packages/embedded-postgres/src/types.ts#L19) 164 | 165 | ___ 166 | 167 | ### port 168 | 169 | • **port**: `number` 170 | 171 | The port where the Postgres database should be listening. Defaults to: 172 | `5432` 173 | 174 | #### Defined in 175 | 176 | [types.ts:9](https://github.com/leinelissen/embedded-postgres/blob/b9360f6/packages/embedded-postgres/src/types.ts#L9) 177 | 178 | ___ 179 | 180 | ### postgresFlags 181 | 182 | • **postgresFlags**: `string`[] 183 | 184 | Pass any additional flags to the postgres process. You can find all 185 | available flags here: 186 | https://www.postgresql.org/docs/current/app-postgres.html. Flags should 187 | be passed as a string array, e.g. `["--debug"]` or `["--locale=en-GB"]`. 188 | 189 | Defaults to `[]`. 190 | 191 | #### Defined in 192 | 193 | [types.ts:34](https://github.com/leinelissen/embedded-postgres/blob/b9360f6/packages/embedded-postgres/src/types.ts#L34) 194 | 195 | ___ 196 | 197 | ### user 198 | 199 | • **user**: `string` 200 | 201 | The username for logging into the Postgres database. Defaults to `postgres` 202 | 203 | #### Defined in 204 | 205 | [types.ts:11](https://github.com/leinelissen/embedded-postgres/blob/b9360f6/packages/embedded-postgres/src/types.ts#L11) 206 | -------------------------------------------------------------------------------- /docs/images/logo-falkland.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/downloader/src/index.ts: -------------------------------------------------------------------------------- 1 | import AdmZip from 'adm-zip'; 2 | import fs from 'fs/promises'; 3 | import { spawnSync } from 'child_process'; 4 | import { coerce } from 'semver'; 5 | import os from 'os'; 6 | import { parseArgs } from 'util'; 7 | 8 | type AcceptedArchs = 'amd64' | 'arm64v8' | 'arm32v6' | 'arm32v7' | 'i386' | 'ppc64le'; 9 | type AcceptedPlatforms = 'darwin' | 'linux' | 'windows'; 10 | 11 | interface PackageJSON { 12 | name?: string; 13 | version?: string; 14 | cpu?: string; 15 | os?: string; 16 | } 17 | 18 | // Specify the command which should be used to check whether a command is 19 | // available on the current system 20 | const whichCommand = os.platform() === 'win32' 21 | ? 'where' 22 | : 'which'; 23 | 24 | /** 25 | * Map the output from os.arch to an architecture that is supported by the 26 | * Postgresql binaries. 27 | */ 28 | function mapArchitecture(arch: string): AcceptedArchs { 29 | switch (arch.toString()) { 30 | case 'arm': 31 | return 'arm32v7'; 32 | case 'arm64': 33 | return 'arm64v8'; 34 | case 'x64': 35 | return 'amd64'; 36 | case 'ppc64': 37 | return 'ppc64le'; 38 | case 'ia32': 39 | return 'i386'; 40 | default: 41 | throw new Error('Unsupported architecture: ' + arch); 42 | } 43 | } 44 | 45 | /** 46 | * Map the output from os.platform to a platform that is supported by the 47 | * Postgresql binaries. 48 | */ 49 | function mapPlatform(platform: string): AcceptedPlatforms { 50 | switch (platform.toString()) { 51 | case 'win32': 52 | return 'windows'; 53 | case 'darwin': 54 | return 'darwin'; 55 | case 'linux': 56 | return 'linux'; 57 | default: 58 | throw new Error('Unsupported platform ' + platform); 59 | } 60 | } 61 | 62 | /** 63 | * Check whether one or more binaries are available on the current system 64 | */ 65 | function hasBinary(bin: string | string[]): boolean { 66 | return (Array.isArray(bin) ? bin : [bin]) 67 | .every((name) => { 68 | const output = spawnSync(whichCommand, [name], { stdio: 'inherit', shell: true }); 69 | return output.status === 0; 70 | }); 71 | } 72 | 73 | /** 74 | * Download the Postgresql binaries for a combination of version, architecture 75 | * and platform. 76 | * 77 | * @param version The version for Postgresql that should be downloaded 78 | * @param arch The platform architecture for which the binary should be downloaded 79 | * @param platform The platform for which the binary should be downloaded 80 | */ 81 | export async function downloadBinaries( 82 | argv: string[], 83 | { cpu: arch, os: platform, version: defaultVersion }: PackageJSON 84 | ) { 85 | // GUARD: Check that the incoming values are correct 86 | if (!argv.length || !arch || !platform) { 87 | console.error('Received unexpected input', { argv, arch, platform }); 88 | throw new Error('Input data for downloader are invalid'); 89 | } 90 | 91 | // Parse the incoming arguments 92 | const { values, positionals } = parseArgs({ 93 | args: argv, 94 | options: { 95 | all: { 96 | type: 'boolean', 97 | description: 'Download all binaries, even if they don\'t match the current system', 98 | default: false, 99 | }, 100 | }, 101 | allowPositionals: true, 102 | }); 103 | 104 | // GUARD: We'll only download mismatching binaries with the current system 105 | // arch and platform if the "--all" flag is supplied 106 | if (!values.all 107 | && (arch.toString() !== process.arch 108 | || platform.toString() !== process.platform) 109 | ) { 110 | console.log(`Skipping download for ${platform}-${arch}, because it does not match the local system (${process.platform}-${process.arch}). If you wish to download all binaries, re-run this command with the "--all" flag.`); 111 | return false; 112 | } 113 | 114 | // Form URL from parameters 115 | const mappedArch = mapArchitecture(arch); 116 | const mappedPlatform = mapPlatform(platform); 117 | const mappedVersion = coerce(positionals[2] || defaultVersion); 118 | const url = `https://repo1.maven.org/maven2/io/zonky/test/postgres/embedded-postgres-binaries-${mappedPlatform}-${mappedArch}/${mappedVersion}/embedded-postgres-binaries-${mappedPlatform}-${mappedArch}-${mappedVersion}.jar`; 119 | 120 | // Download file 121 | const jar = await fetch(url).then((f) => { 122 | if (f.status !== 200) { 123 | throw new Error('Archive not found ' + url); 124 | } 125 | return f.arrayBuffer(); 126 | }); 127 | 128 | // Extract the archive containing the binaries from the JAR 129 | const unpackedJar = new AdmZip(Buffer.from(jar)); 130 | const jarEntries = unpackedJar.getEntries(); 131 | const archive = jarEntries.find((f) => f.entryName.endsWith('txz')); 132 | 133 | // GUARD: Check if the binaries archive can be found 134 | if (!archive) { 135 | const filename = url.split('/').slice(-1)[0]; 136 | throw new Error('Could not find archive containing binaries in ' + filename); 137 | } 138 | 139 | // Store the file on disk so that we can pass it to tar 140 | const data = archive.getData(); 141 | await fs.rm('native', { recursive: true }).catch(() => ''); 142 | await fs.mkdir('native').catch(() => ''); 143 | await fs.writeFile('native.txz', data); 144 | 145 | // Then extract the file with either tar, if it's available... 146 | // NOTE: we cannot use tar on windows because it will fuck up the symlinks 147 | if (os.platform() !== 'win32' && hasBinary(['tar', 'xz'])) { 148 | // Call tar 149 | const tarOutput = spawnSync('tar', ['xvf', 'native.txz', '-C', 'native'], { stdio: 'inherit' }); 150 | 151 | // GUARD: Check that the output is satisfactory 152 | if (tarOutput.status !== 0) { 153 | console.error(tarOutput.output); 154 | throw new Error('Failed to extract tar with binaries...'); 155 | } 156 | } else if (hasBinary(['7z'])) { 157 | // Call 7zip first, because tar on Windows hangs if it has to call a decompressor externally 158 | const xzOutput = spawnSync('7z', ['x', 'native.txz', '-aoa'], { stdio: 'inherit', shell: true }); 159 | 160 | // GUARD: Check that the output is satisfactory 161 | if (xzOutput.status !== 0) { 162 | console.error(xzOutput.output); 163 | throw new Error('Failed to decompress tar with binaries...'); 164 | } 165 | 166 | // Call tar 167 | const tarOutput = spawnSync('7z', ['x', 'native.tar', '-o"native"', '-aoa'], { stdio: 'inherit', shell: true }); 168 | 169 | // GUARD: Check that the output is satisfactory 170 | if (tarOutput.status !== 0) { 171 | console.error(tarOutput.output); 172 | throw new Error('Failed to extract tar with binaries...'); 173 | } 174 | 175 | // Delete the intermediate format 176 | await fs.unlink('native.tar'); 177 | } else { 178 | // Abort to the user when unpacking utilities are missing 179 | throw new Error('Failed to unpack as system packages are missing. Please install both the "tar" and "xz" / "zstd" utils'); 180 | } 181 | 182 | // Remove the archive 183 | await fs.unlink('native.txz'); 184 | 185 | return true; 186 | } 187 | -------------------------------------------------------------------------------- /packages/embedded-postgres/README.md: -------------------------------------------------------------------------------- 1 | ![Embedded 2 | Postgres](https://github.com/leinelissen/embedded-postgres/raw/main/docs/images/embedded-postgres-header.svg) 3 | 4 |
5 | 6 | ![npm](https://img.shields.io/npm/v/embedded-postgres) 7 | ![npm type definitions](https://img.shields.io/npm/types/embedded-postgres) 8 | ![npm](https://img.shields.io/npm/dy/embedded-postgres) 9 | ![NPM](https://img.shields.io/npm/l/embedded-postgres) 10 | ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/leinelissen/embedded-postgres/test.yml) 11 | 12 | 13 |
14 | 15 |

16 | 🐘 A Node package that spawns PostgresQL clusters programatically. 17 |

18 | 19 | ## Installation 20 | `embedded-postgres` is available from NPM: 21 | 22 | ```sh 23 | npm i embedded-postgres 24 | ``` 25 | 26 |
27 | 28 | ## Usage 29 | This package contains a simple API that allows you to create clusters, start 30 | them, create / delete database and stop any existing processes. 31 | 32 | ```ts 33 | import EmbeddedPostgres from 'embedded-postgres'; 34 | 35 | async function main() { 36 | // Create the object 37 | const pg = new EmbeddedPostgres({ 38 | databaseDir: './data/db', 39 | user: 'postgres', 40 | password: 'password', 41 | port: 5432, 42 | persistent: true, 43 | }); 44 | 45 | // Create the cluster config files 46 | await pg.initialise(); 47 | 48 | // Start the server 49 | await pg.start(); 50 | 51 | // Create and/or drop database 52 | await pg.createDatabase('TEST'); 53 | await pg.dropDatabase('TEST'); 54 | 55 | // Initialize a node-postgres client 56 | const client = pg.getPgClient(); 57 | await client.connect(); 58 | const result = await client.query('SELECT datname FROM pg_database'); 59 | 60 | // Stop the server 61 | await pg.stop(); 62 | } 63 | 64 | main(); 65 | ``` 66 | 67 |
68 | 69 | ## PostgresQL Versions 70 | This package aims to track the [PostgresQL support 71 | policy](https://www.postgresql.org/support/versioning/) for supported versions. 72 | Additionally, we track the binaries that are created upstream in [zonky's 73 | embedded-postgres-binaries](https://github.com/zonkyio/embedded-postgres). This 74 | leads to the following current support matrix: 75 | 76 | | Platform / Architecture | 12.20.0 | 13.16.0 | 14.13.0 | 15.8.0 | 16.4.0 | 17.0.0 | 77 | |---------------------------|---------|---------|---------|--------|--------|--------| 78 | | 🍎 Darwin / x64 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 79 | | 🍎 Darwin / arm64[[1]](https://github.com/zonkyio/embedded-postgres/issues/86#issuecomment-1120425822) | 🚫 | 🚫 | 🚫 | ✅ | ✅ | ✅ | 80 | | 🪟 Windows / x64 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 81 | | 🐧 Linux / x64 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 82 | | 🐧 Linux / arm | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 83 | | 🐧 Linux / arm64 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 84 | | 🐧 Linux / ia32 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 85 | | 🐧 Linux / ppc64 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 86 | 87 | In order to install a particular version, look for the latest tag in 88 | [NPM](https://www.npmjs.com/package/embedded-postgres). For example, if you 89 | would like to install `v10.20.0`, you can currently use the following tag: 90 | ```sh 91 | npm i embedded-postgres@10.20.0-beta.6 92 | ``` 93 | 94 | Installing particular versions of PostgresQL (i.e. versions not released on NPM) 95 | is currently not possible. If you would have a need for doing so, please create 96 | an issue. 97 | 98 |
99 | 100 | ## API 101 | Options in the constructor can be used to modify the behaviour of the 102 | application. The parameters that are available as part of the options can be 103 | seen here: 104 | 105 | | Property | Type | Description | 106 | |---|---|---| 107 | | databaseDir | string | The location where the data should be persisted to. Defaults to `./data/db` | 108 | | port | number | The port where the Postgres database should be listening. Defaults to: `5432` | 109 | | user | string | The username for logging into the Postgres database. Defaults to `postgres` | 110 | | password | string | The password for logging into the Postgres database. Defaults to `password` | 111 | | authMethod | 'scram-sha-256' \| 'password' \| 'md5' | The authentication method to use when authenticating against Postgres. Defaults to `password` | 112 | | persistent | boolean | Whether all data should be left in place when the database is shut down. Defaults to `true`. | 113 | | initdbFlags | string[] | Pass any additional flags to the initdb process. You can find all available flags here: https://www.postgresql.org/docs/current/app-initdb.html. Flags should be passed as a string array, e.g. `["--debug"]` or `["--locale=en-GB"]` Defaults to `[]` 114 | | postgresFlags | string[] | Pass any additional flags to the postgres process. You can find all available flags here: https://www.postgresql.org/docs/current/app-postgres.html. Flags should be passed as a string array, e.g. `["--debug"]` or `["--locale=en-GB"]`. Defaults to `[]`. | 115 | | createPostgresUser | boolean | Postgres does not allow binaries to be run by root. In case you're running in root-only enviroments, such as Docker containers, you may need to create an extra user on your system in order to be able to call the binaries.
NOTE: This WILL irreversibly modify your host system. The effects are somewhat minor, but it's still recommend to only use this in Docker containers. Defaults to `false`. | 116 | | onLog | (message \| string) => void | Pass in a custom logging handler. This will relay and console messages that are generated by the postgres and initdb processes. Defaults to `console.log` | 117 | | onError | (messageOrError \| string \| Error \| unknown) => void | Pass in a custom error logging handler. This will catch and stderr results coming in from the postgres and initdb processes. Defaults to `console.error` | 118 | 119 |
120 | 121 | ## Contributing 122 | This package is open to issues, feedback, ideas and pull requests. Create an 123 | issue on this repository to get started! In order to get started with 124 | development, you might need some extra pointers 125 | 126 | ### Development 127 | In order to get yourself situated for development, you will need to the 128 | repository up and running. In order to make this work, start with a relatively 129 | recent install of NodeJS (at least v18, v20+ recommended). You can then run this 130 | command to install all packages: 131 | ``` 132 | npm install --force 133 | ``` 134 | 135 | > [!NOTE] 136 | > You must include `--force` or else NPM will refuse to install the 137 | > dependencies for all packages, including those not for the current architecture. 138 | 139 | Then, you must pre-compile all Typescript using the following command: 140 | ``` 141 | npm run build 142 | ``` 143 | 144 | As soon as that is complete, we'll download the requisite PostgresQL binaries 145 | for your particular architecture using: 146 | ``` 147 | npm run download 148 | ``` 149 | 150 | Lastly, you can hop over to `packages/embedded-postgres` and do some development 151 | there: 152 | ``` 153 | cd packages/embedded-postgres 154 | ``` 155 | 156 | You can force automatic recompliation of the Typescript files by running: 157 | ``` 158 | npm start 159 | ``` 160 | 161 | Don't forget to add and run tests when you are developing new functionality. Add 162 | them to `tests/index.test.ts`, and run the tests by running: 163 | ``` 164 | npm test 165 | ``` 166 | 167 |
168 | 169 | ## Troubleshotting 170 | 171 | ### Running in Docker containers 172 | Running in Docker containers might fail, because many are setup to run with the 173 | root user as default. Either you resolve to setting up a container with a 174 | specific user yourself, or you set the `createPostgresUser` option to true, 175 | after which embedded-postgres will automatically set up a postgres user on the 176 | system for usage by your script. 177 | 178 |
179 | 180 | ## Credits and Licensing 181 | Embedded Postgres was created by Lei Nelissen for [BMD 182 | Studio](https://bmd.studio). It is based on [zonky's 183 | embedded-postgres-binaries](https://github.com/zonkyio/embedded-postgres). The 184 | binaries are made available under the Apache License 2.0, whereas the specific 185 | code in this package is made available under the MIT license. 186 | 187 | 188 | BMD Studio 189 | 190 | 191 |
192 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Embedded Postgres](./docs/images/embedded-postgres-header.svg) 2 | 3 |
4 | 5 | ![npm](https://img.shields.io/npm/v/embedded-postgres) 6 | ![npm type definitions](https://img.shields.io/npm/types/embedded-postgres) 7 | ![npm](https://img.shields.io/npm/dy/embedded-postgres) 8 | ![NPM](https://img.shields.io/npm/l/embedded-postgres) 9 | ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/leinelissen/embedded-postgres/test.yml) 10 | 11 | 12 |
13 | 14 |

15 | 🐘 A Node package that spawns PostgresQL clusters programatically. 16 |

17 | 18 | ## Installation 19 | `embedded-postgres` is available from NPM: 20 | 21 | ```sh 22 | npm i embedded-postgres 23 | ``` 24 | 25 |
26 | 27 | ## Usage 28 | This package contains a simple API that allows you to create clusters, start 29 | them, create / delete database and stop any existing processes. 30 | 31 | ```ts 32 | import EmbeddedPostgres from 'embedded-postgres'; 33 | 34 | async function main() { 35 | // Create the object 36 | const pg = new EmbeddedPostgres({ 37 | databaseDir: './data/db', 38 | user: 'postgres', 39 | password: 'password', 40 | port: 5432, 41 | persistent: true, 42 | }); 43 | 44 | // Create the cluster config files 45 | await pg.initialise(); 46 | 47 | // Start the server 48 | await pg.start(); 49 | 50 | // Create and/or drop database 51 | await pg.createDatabase('TEST'); 52 | await pg.dropDatabase('TEST'); 53 | 54 | // Initialize a node-postgres client 55 | const client = pg.getPgClient(); 56 | await client.connect(); 57 | const result = await client.query('SELECT datname FROM pg_database'); 58 | 59 | // Stop the server 60 | await pg.stop(); 61 | } 62 | 63 | main(); 64 | ``` 65 | 66 |
67 | 68 | ## PostgresQL Versions 69 | This package aims to track the [PostgresQL support 70 | policy](https://www.postgresql.org/support/versioning/) for supported versions. 71 | Additionally, we track the binaries that are created upstream in [zonky's 72 | embedded-postgres-binaries](https://github.com/zonkyio/embedded-postgres). This 73 | leads to the following current support matrix: 74 | 75 | | Platform / Architecture | 13.23.0 | 14.20.0 | 15.15.0 | 16.11.0 | 17.7.0 | 18.1.0 | 76 | |---------------------------|---------|---------|---------|---------|--------|--------| 77 | | 🍎 Darwin / x64 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 78 | | 🍎 Darwin / arm64[[1]](https://github.com/zonkyio/embedded-postgres/issues/86#issuecomment-1120425822) | 🚫 | ✅ | ✅ | ✅ | ✅ | ✅ | 79 | | 🪟 Windows / x64 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 80 | | 🐧 Linux / x64 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 81 | | 🐧 Linux / arm | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 82 | | 🐧 Linux / arm64 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 83 | | 🐧 Linux / ia32 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 84 | | 🐧 Linux / ppc64 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 85 | 86 | In order to install a particular version, look for the latest tag in 87 | [NPM](https://www.npmjs.com/package/embedded-postgres). For example, if you 88 | would like to install `v10.20.0`, you can currently use the following tag: 89 | ```sh 90 | npm i embedded-postgres@10.20.0-beta.6 91 | ``` 92 | 93 | Installing particular versions of PostgresQL (i.e. versions not released on NPM) 94 | is currently not possible. If you would have a need for doing so, please create 95 | an issue. 96 | 97 |
98 | 99 | ## API 100 | Options in the constructor can be used to modify the behaviour of the 101 | application. The parameters that are available as part of the options can be 102 | seen here: 103 | 104 | | Property | Type | Description | 105 | |---|---|---| 106 | | databaseDir | string | The location where the data should be persisted to. Defaults to `./data/db` | 107 | | port | number | The port where the Postgres database should be listening. Defaults to: `5432` | 108 | | user | string | The username for logging into the Postgres database. Defaults to `postgres` | 109 | | password | string | The password for logging into the Postgres database. Defaults to `password` | 110 | | authMethod | 'scram-sha-256' \| 'password' \| 'md5' | The authentication method to use when authenticating against Postgres. Defaults to `password` | 111 | | persistent | boolean | Whether all data should be left in place when the database is shut down. Defaults to `true`. | 112 | | initdbFlags | string[] | Pass any additional flags to the initdb process. You can find all available flags here: https://www.postgresql.org/docs/current/app-initdb.html. Flags should be passed as a string array, e.g. `["--debug"]` or `["--locale=en-GB"]` Defaults to `[]` 113 | | postgresFlags | string[] | Pass any additional flags to the postgres process. You can find all available flags here: https://www.postgresql.org/docs/current/app-postgres.html. Flags should be passed as a string array, e.g. `["--debug"]` or `["--locale=en-GB"]`. Defaults to `[]`. | 114 | | createPostgresUser | boolean | Postgres does not allow binaries to be run by root. In case you're running in root-only enviroments, such as Docker containers, you may need to create an extra user on your system in order to be able to call the binaries.
NOTE: This WILL irreversibly modify your host system. The effects are somewhat minor, but it's still recommend to only use this in Docker containers. Defaults to `false`. | 115 | | onLog | (message \| string) => void | Pass in a custom logging handler. This will relay and console messages that are generated by the postgres and initdb processes. Defaults to `console.log` | 116 | | onError | (messageOrError \| string \| Error \| unknown) => void | Pass in a custom error logging handler. This will catch and stderr results coming in from the postgres and initdb processes. Defaults to `console.error` | 117 | 118 |
119 | 120 | ## Contributing 121 | This package is open to issues, feedback, ideas and pull requests. Create an 122 | issue on this repository to get started! In order to get started with 123 | development, you might need some extra pointers 124 | 125 | ### Development 126 | In order to get yourself situated for development, you will need to the 127 | repository up and running. In order to make this work, start with a relatively 128 | recent install of NodeJS (at least v18, v20+ recommended). You can then run this 129 | command to install all packages: 130 | ``` 131 | npm install --force 132 | ``` 133 | 134 | > [!NOTE] 135 | > You must include `--force` or else NPM will refuse to install the 136 | > dependencies for all packages, including those not for the current architecture. 137 | 138 | Then, you must pre-compile all Typescript using the following command: 139 | ``` 140 | npm run build 141 | ``` 142 | 143 | As soon as that is complete, we'll download the requisite PostgresQL binaries 144 | for your particular architecture using: 145 | ``` 146 | npm run download 147 | ``` 148 | 149 | Lastly, you can hop over to `packages/embedded-postgres` and do some development 150 | there: 151 | ``` 152 | cd packages/embedded-postgres 153 | ``` 154 | 155 | You can force automatic recompliation of the Typescript files by running: 156 | ``` 157 | npm start 158 | ``` 159 | 160 | Don't forget to add and run tests when you are developing new functionality. Add 161 | them to `tests/index.test.ts`, and run the tests by running: 162 | ``` 163 | npm test 164 | ``` 165 | 166 |
167 | 168 | ## Troubleshotting 169 | 170 | ### Running in Docker containers 171 | Running in Docker containers might fail, because many are setup to run with the 172 | root user as default. Either you resolve to setting up a container with a 173 | specific user yourself, or you set the `createPostgresUser` option to true, 174 | after which embedded-postgres will automatically set up a postgres user on the 175 | system for usage by your script. 176 | 177 |
178 | 179 | ## Credits and Licensing 180 | Embedded Postgres was created by Lei Nelissen for [BMD 181 | Studio](https://bmd.studio). It is currently maintained by [Studio Falkland](https://falkland.studio) The package is based on [zonky's 182 | embedded-postgres-binaries](https://github.com/zonkyio/embedded-postgres). 183 | 184 | The 185 | binaries are made available under the Apache License 2.0, whereas the specific 186 | code in this package is made available under the MIT license. 187 | 188 |

189 | 190 | BMD Studio 191 | 192 | 193 | Studio Falkland 194 | 195 |

196 | 197 |
198 | -------------------------------------------------------------------------------- /packages/embedded-postgres/src/index.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import crypto from 'crypto'; 3 | import fs from 'fs/promises'; 4 | import { platform, tmpdir, userInfo } from 'os'; 5 | import { ChildProcess, spawn, exec } from 'child_process'; 6 | 7 | import pg from 'pg'; 8 | import AsyncExitHook from 'async-exit-hook'; 9 | 10 | import getBinaries from './binary.js'; 11 | import { PostgresOptions } from './types.js'; 12 | 13 | const bin = getBinaries(); 14 | const { Client } = pg; 15 | 16 | /** 17 | * We have to specify the LC_MESSAGES locale because we rely on inspecting the 18 | * output of the `initdb` command to see if Postgres is ready. As we're looking 19 | * for a particular string, we need to force that string into the right locale. 20 | * @see https://github.com/leinelissen/embedded-postgres/issues/15 21 | */ 22 | const LC_MESSAGES_LOCALE = 'en_US.UTF-8'; 23 | 24 | /** 25 | * Previosuly, options were specified in snake_case rather than camelCase. Old 26 | * options are still translated to new variants. 27 | */ 28 | interface LegacyOptions { 29 | database_dir: string; 30 | auth_method: 'scram-sha-256' | 'password' | 'md5'; 31 | } 32 | 33 | // The default configuration options for the class 34 | const defaults: PostgresOptions = { 35 | databaseDir: path.join(process.cwd(), 'data', 'db'), 36 | port: 5432, 37 | user: 'postgres', 38 | password: 'password', 39 | authMethod: 'password', 40 | persistent: true, 41 | initdbFlags: [], 42 | postgresFlags: [], 43 | createPostgresUser: false, 44 | onLog: console.log, 45 | onError: console.error, 46 | }; 47 | 48 | /** 49 | * This will track instances of all current initialised clusters. We need this 50 | * because we want to be able to shutdown any clusters when the script is exited. 51 | */ 52 | const instances = new Set(); 53 | 54 | /** 55 | * This class creates an instance from which a single Postgres cluster is 56 | * managed. Note that many clusters may be created, but they will need seperate 57 | * data directories in order to be properly lifecycle managed. 58 | */ 59 | class EmbeddedPostgres { 60 | protected options: PostgresOptions; 61 | 62 | private process?: ChildProcess; 63 | 64 | private isRootUser: boolean; 65 | 66 | constructor(options: Partial = {}) { 67 | // Options were previously specified in snake_case rather than 68 | // camelCase. We still want to accept the old style of options. 69 | const legacyOptions: Partial = {}; 70 | if ((options as LegacyOptions).database_dir) { 71 | legacyOptions.databaseDir = (options as LegacyOptions).database_dir; 72 | } 73 | if ((options as LegacyOptions).auth_method) { 74 | legacyOptions.authMethod = (options as LegacyOptions).auth_method; 75 | } 76 | 77 | // Assign default options to options object 78 | this.options = Object.assign({}, defaults, legacyOptions, options); 79 | 80 | instances.add(this); 81 | 82 | this.isRootUser = userInfo().uid === 0; 83 | } 84 | 85 | /** 86 | * This function needs to be called whenever a Postgres cluster first needs 87 | * to be created. It will populate the data directory with the right 88 | * settings. If your Postgres cluster is already initialised, you don't need 89 | * to call this function again. 90 | */ 91 | async initialise() { 92 | const { postgres, initdb } = await bin; 93 | 94 | // GUARD: Check that a postgres user is available 95 | await this.checkForRootUser(); 96 | 97 | // Optionally retrieve the uid and gid 98 | let permissionIds = await this.getUidAndGid() 99 | .catch(() => ({})); 100 | 101 | // GUARD: Check if we need to create users 102 | if (this.options.createPostgresUser 103 | && !('uid' in permissionIds) 104 | && !('gid' in permissionIds) 105 | ) { 106 | try { 107 | // Create the group and user 108 | await execAsync('groupadd postgres'); 109 | await execAsync('useradd -g postgres postgres'); 110 | 111 | // Re-treieve the permission ids now the user exists 112 | permissionIds = await this.getUidAndGid(); 113 | } catch (err) { 114 | this.options.onError(err); 115 | throw new Error('Failed to create and initialize a new user on this system.'); 116 | } 117 | } 118 | 119 | // GUARD: Ensure that the data directory is owned by the created user 120 | if (this.options.createPostgresUser) { 121 | if (!('uid' in permissionIds)) { 122 | throw new Error('Failed to retrieve the uid for the newly created user.'); 123 | } 124 | 125 | // Create the data directory and have the user own it, so we 126 | // don't get any permission errors 127 | await fs.mkdir(this.options.databaseDir, { recursive: true }); 128 | await fs.chown(this.options.databaseDir, permissionIds.uid, permissionIds.gid); 129 | } 130 | 131 | // Create a file on disk that contains the password in plaintext 132 | const randomId = crypto.randomBytes(6).readUIntLE(0,6).toString(36); 133 | const passwordFile = path.resolve(tmpdir(), `pg-password-${randomId}`); 134 | await fs.writeFile(passwordFile, this.options.password + '\n'); 135 | 136 | // Greedily make the file executable, in case it is not 137 | await fs.chmod(postgres, '755'); 138 | await fs.chmod(initdb, '755'); 139 | 140 | // Initialize the database 141 | await new Promise((resolve, reject) => { 142 | const process = spawn(initdb, [ 143 | `--pgdata=${this.options.databaseDir}`, 144 | `--auth=${this.options.authMethod}`, 145 | `--username=${this.options.user}`, 146 | `--pwfile=${passwordFile}`, 147 | `--lc-messages=${LC_MESSAGES_LOCALE}`, 148 | ...this.options.initdbFlags, 149 | ], { ...permissionIds, env: { LC_MESSAGES: LC_MESSAGES_LOCALE } }); 150 | 151 | // Connect to stderr, as that is where the messages get sent 152 | process.stdout?.on('data', (chunk: Buffer) => { 153 | // Parse the data as a string and log it 154 | const message = chunk.toString('utf-8'); 155 | this.options.onLog(message); 156 | }); 157 | 158 | process.on('exit', (code) => { 159 | if (code === 0) { 160 | resolve(); 161 | } else { 162 | reject(`Postgres init script exited with code ${code}. Please check the logs for extra info. The data directory might already exist.`); 163 | } 164 | }); 165 | }); 166 | 167 | // Clean up the file 168 | await fs.unlink(passwordFile); 169 | } 170 | 171 | /** 172 | * Start the Postgres cluster with the given configuration. The cluster is 173 | * started as a seperate process, unmanaged by NodeJS. It is automatically 174 | * shut down when the script exits. 175 | */ 176 | async start() { 177 | const { postgres } = await bin; 178 | 179 | // Optionally retrieve the uid and gid 180 | const permissionIds = await this.getUidAndGid() 181 | .catch(() => { 182 | throw new Error('Postgres cannot run as a root user. embedded-postgres could not find a postgres user to run as instead. Consider using the `createPostgresUser` option.'); 183 | }); 184 | 185 | // Greedily make the file executable, in case it is not 186 | await fs.chmod(postgres, '755'); 187 | 188 | await new Promise((resolve, reject) => { 189 | // Spawn a postgres server 190 | this.process = spawn(postgres, [ 191 | '-D', 192 | this.options.databaseDir, 193 | '-p', 194 | this.options.port.toString(), 195 | ...this.options.postgresFlags, 196 | ], { ...permissionIds, env: { LC_MESSAGES: LC_MESSAGES_LOCALE } }); 197 | 198 | // Connect to stderr, as that is where the messages get sent 199 | this.process.stderr?.on('data', (chunk: Buffer) => { 200 | // Parse the data as a string and log it 201 | const message = chunk.toString('utf-8'); 202 | this.options.onLog(message); 203 | 204 | // GUARD: Check for the right message to determine server start 205 | if (message.includes('database system is ready to accept connections')) { 206 | resolve(); 207 | } 208 | }); 209 | 210 | // In case the process exits early, the promise is rejected. 211 | this.process.on('close', () => { 212 | reject(); 213 | }); 214 | }); 215 | } 216 | 217 | /** 218 | * Stop an already started cluster with the given configuration. 219 | * NOTE: If you have `persisent` set to false, this method WILL DELETE your 220 | * database files. You will need to call `.initialise()` again after executing 221 | * this method. 222 | */ 223 | async stop() { 224 | // GUARD: If no database is running, immdiately return the function. 225 | if (!this.process) { 226 | return; 227 | } 228 | 229 | // Kill the existing postgres process 230 | await new Promise((resolve) => { 231 | // Register a handler for when the process finally exists 232 | this.process?.on('exit', resolve); 233 | 234 | // GUARD: Check if we're on Windows, since Windows doesn't support SIGINT 235 | if (platform() === 'win32') { 236 | // GUARD: Double check the pid is there to keep TypeScript happy 237 | if (!this.process?.pid) { 238 | throw new Error('Could not find process PID'); 239 | } 240 | 241 | // Actually kill the process using the Windows taskkill command 242 | spawn('taskkill', ['/pid', this.process.pid.toString(), '/f', '/t']); 243 | } else { 244 | // If on a sane OS, simply kill using SIGINT 245 | this.process?.kill('SIGINT'); 246 | } 247 | }); 248 | 249 | // Clean up process 250 | this.process = undefined; 251 | 252 | // GUARD: Additional work if database is not persistent 253 | if (this.options.persistent === false) { 254 | // Delete the data directory 255 | await fs.rm(this.options.databaseDir, { recursive: true, force: true }); 256 | } 257 | } 258 | 259 | /** 260 | * Create a node-postgres client using the existing cluster configuration. 261 | * 262 | * @param database The database that the postgres client should connect to 263 | * @param host The host that should be pre-filled in the connection options 264 | * @returns Client 265 | */ 266 | getPgClient(database = 'postgres', host = 'localhost') { 267 | // Create client 268 | const client = new Client({ 269 | user: this.options.user, 270 | password: this.options.password, 271 | port: this.options.port, 272 | host, 273 | database, 274 | }); 275 | 276 | // Log errors rather than throwing them so that embedded-postgres has 277 | // enough time to actually shutdown. 278 | client.on('error', this.options.onError); 279 | 280 | return client; 281 | } 282 | 283 | /** 284 | * Create a database with a given name on the cluster 285 | */ 286 | async createDatabase(name: string) { 287 | // GUARD: Cluster must be running for performing database operations 288 | if (!this.process) { 289 | throw new Error('Your cluster must be running before you can create a database'); 290 | } 291 | 292 | // Get client and execute CREATE DATABASE query 293 | const client = this.getPgClient(); 294 | await client.connect(); 295 | await client.query(`CREATE DATABASE ${client.escapeIdentifier(name)}`); 296 | 297 | // Clean up client 298 | await client.end(); 299 | } 300 | 301 | /** 302 | * Drop a database with a given name on the cluster 303 | */ 304 | async dropDatabase(name: string) { 305 | // GUARD: Cluster must be running for performing database operations 306 | if (!this.process) { 307 | throw new Error('Your cluster must be running before you can create a database'); 308 | } 309 | 310 | // Get client and execute DROP DATABASE query 311 | const client = this.getPgClient(); 312 | await client.connect(); 313 | await client.query(`DROP DATABASE ${client.escapeIdentifier(name)}`); 314 | 315 | // Clean up client 316 | await client.end(); 317 | } 318 | 319 | /** 320 | * Warn the user in case they're trying to run this library as a root user 321 | */ 322 | private async checkForRootUser() { 323 | // GUARD: Ensure that the user isn't root 324 | if (!this.isRootUser) { 325 | return; 326 | } 327 | 328 | // Attempt to retrieve the uid and gid for the postgres user. This check 329 | // will throw and error when the postgres user doesn't exist 330 | try { 331 | await this.getUidAndGid(); 332 | } catch (err) { 333 | // GUARD: No user exists, but check that a postgres user should be created 334 | if (!this.options.createPostgresUser) { 335 | throw new Error('You are running this script as root. Postgres does not support running as root. If you wish to continue, configure embedded-postgres to create a Postgres user by setting the `createPostgresUser` option to true.'); 336 | } 337 | } 338 | } 339 | 340 | /** 341 | * Retrieve the uid and gid for a particular user 342 | */ 343 | private async getUidAndGid(name = 'postgres') { 344 | if (!this.isRootUser) { 345 | return {} as Record; 346 | } 347 | 348 | const [uid, gid] = await Promise.all([ 349 | execAsync(`id -u ${name}`).then(Number.parseInt), 350 | execAsync(`id -g ${name}`).then(Number.parseInt), 351 | ]); 352 | 353 | return { uid, gid }; 354 | } 355 | } 356 | 357 | /** 358 | * A promisified version of the exec API that either throws on errors or returns 359 | * the string results from the executed command. 360 | */ 361 | async function execAsync(command: string) { 362 | return new Promise((resolve, reject) => { 363 | exec(command, (error, stdout) => { 364 | if (error) { 365 | reject(error); 366 | } else { 367 | resolve(stdout); 368 | } 369 | }); 370 | }); 371 | } 372 | 373 | /** 374 | * This script should be called when a Node script is exited, so that we can 375 | * nicely shutdown all potentially started clusters, and we don't end up with 376 | * zombie processes. 377 | */ 378 | async function gracefulShutdown(done: () => void) { 379 | // Loop through all instances, stop them, and await the response 380 | await Promise.all([...instances].map((instance) => { 381 | return instance.stop(); 382 | })); 383 | 384 | // Let NodeJS know we're done 385 | done(); 386 | } 387 | 388 | // Register graceful shutdown function 389 | AsyncExitHook(gracefulShutdown); 390 | 391 | export default EmbeddedPostgres; -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # [1.0.0](https://github.com/leinelissen/embedded-postgres/compare/v17.2.0-beta.15...v1.0.0) (2024-12-04) 2 | 3 | 4 | 5 | # [17.2.0-beta.15](https://github.com/leinelissen/embedded-postgres/compare/v16.6.0-beta.15...v17.2.0-beta.15) (2024-12-04) 6 | 7 | 8 | 9 | # [16.6.0-beta.15](https://github.com/leinelissen/embedded-postgres/compare/v15.10.0-beta.15...v16.6.0-beta.15) (2024-12-04) 10 | 11 | 12 | 13 | # [15.10.0-beta.15](https://github.com/leinelissen/embedded-postgres/compare/v14.15.0-beta.15...v15.10.0-beta.15) (2024-12-04) 14 | 15 | 16 | 17 | # [14.15.0-beta.15](https://github.com/leinelissen/embedded-postgres/compare/v13.18.0-beta.15...v14.15.0-beta.15) (2024-12-04) 18 | 19 | 20 | 21 | # [13.18.0-beta.15](https://github.com/leinelissen/embedded-postgres/compare/v12.22.0-beta.15...v13.18.0-beta.15) (2024-12-04) 22 | 23 | 24 | 25 | # [12.22.0-beta.15](https://github.com/leinelissen/embedded-postgres/compare/v17.2.0-beta.14...v12.22.0-beta.15) (2024-12-04) 26 | 27 | 28 | ### Bug Fixes 29 | 30 | * explicitly specify LC_MESSAGES locale initialise completes on non-english systems ([2780bd3](https://github.com/leinelissen/embedded-postgres/commit/2780bd3da684568c764a53bf1bae9205db5899ee)) 31 | * run tests with a different locale ([d5de85f](https://github.com/leinelissen/embedded-postgres/commit/d5de85f530cec13959565f3e22ada1fbf3c679c7)) 32 | 33 | 34 | 35 | # [17.2.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v16.6.0-beta.14...v17.2.0-beta.14) (2024-11-25) 36 | 37 | 38 | 39 | # [16.6.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v15.10.0-beta.14...v16.6.0-beta.14) (2024-11-25) 40 | 41 | 42 | 43 | # [15.10.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v14.15.0-beta.14...v15.10.0-beta.14) (2024-11-25) 44 | 45 | 46 | 47 | # [14.15.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v13.18.0-beta.14...v14.15.0-beta.14) (2024-11-25) 48 | 49 | 50 | 51 | # [13.18.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v12.22.0-beta.14...v13.18.0-beta.14) (2024-11-25) 52 | 53 | 54 | 55 | # [12.22.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v17.1.0-beta.14...v12.22.0-beta.14) (2024-11-25) 56 | 57 | 58 | 59 | # [17.1.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v16.5.0-beta.14...v17.1.0-beta.14) (2024-11-25) 60 | 61 | 62 | 63 | # [16.5.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v15.9.0-beta.14...v16.5.0-beta.14) (2024-11-25) 64 | 65 | 66 | 67 | # [15.9.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v14.14.0-beta.14...v15.9.0-beta.14) (2024-11-25) 68 | 69 | 70 | 71 | # [14.14.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v13.17.0-beta.14...v14.14.0-beta.14) (2024-11-25) 72 | 73 | 74 | 75 | # [13.17.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v12.21.0-beta.14...v13.17.0-beta.14) (2024-11-25) 76 | 77 | 78 | 79 | # [12.21.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v17.0.0-beta.14...v12.21.0-beta.14) (2024-11-25) 80 | 81 | 82 | 83 | # [17.0.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v16.4.0-beta.14...v17.0.0-beta.14) (2024-11-13) 84 | 85 | 86 | 87 | # [16.4.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v15.8.0-beta.14...v16.4.0-beta.14) (2024-11-13) 88 | 89 | 90 | 91 | # [15.8.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v14.13.0-beta.14...v15.8.0-beta.14) (2024-11-13) 92 | 93 | 94 | 95 | # [14.13.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v13.16.0-beta.14...v14.13.0-beta.14) (2024-11-13) 96 | 97 | 98 | 99 | # [13.16.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v12.20.0-beta.14...v13.16.0-beta.14) (2024-11-13) 100 | 101 | 102 | 103 | # [12.20.0-beta.14](https://github.com/leinelissen/embedded-postgres/compare/v17.0.0-beta.13...v12.20.0-beta.14) (2024-11-13) 104 | 105 | 106 | ### Bug Fixes 107 | 108 | * ensure the packages are built correctly when releasing ([5aa8eea](https://github.com/leinelissen/embedded-postgres/commit/5aa8eea2d0aa65d3950796469b9aed0531109f60)) 109 | 110 | 111 | 112 | # [17.0.0-beta.13](https://github.com/leinelissen/embedded-postgres/compare/v16.4.0-beta.13...v17.0.0-beta.13) (2024-11-08) 113 | 114 | 115 | 116 | # [16.4.0-beta.13](https://github.com/leinelissen/embedded-postgres/compare/v15.8.0-beta.13...v16.4.0-beta.13) (2024-11-08) 117 | 118 | 119 | 120 | # [15.8.0-beta.13](https://github.com/leinelissen/embedded-postgres/compare/v14.13.0-beta.13...v15.8.0-beta.13) (2024-11-08) 121 | 122 | 123 | 124 | # [14.13.0-beta.13](https://github.com/leinelissen/embedded-postgres/compare/v13.16.0-beta.13...v14.13.0-beta.13) (2024-11-08) 125 | 126 | 127 | 128 | # [13.16.0-beta.13](https://github.com/leinelissen/embedded-postgres/compare/v12.20.0-beta.13...v13.16.0-beta.13) (2024-11-08) 129 | 130 | 131 | 132 | # [12.20.0-beta.13](https://github.com/leinelissen/embedded-postgres/compare/v17.0.0-beta.12...v12.20.0-beta.13) (2024-11-08) 133 | 134 | 135 | 136 | # [17.0.0-beta.12](https://github.com/leinelissen/embedded-postgres/compare/v16.4.0-beta.12...v17.0.0-beta.12) (2024-10-01) 137 | 138 | 139 | 140 | # [16.4.0-beta.12](https://github.com/leinelissen/embedded-postgres/compare/v15.8.0-beta.12...v16.4.0-beta.12) (2024-08-12) 141 | 142 | 143 | 144 | # [15.8.0-beta.12](https://github.com/leinelissen/embedded-postgres/compare/v14.13.0-beta.12...v15.8.0-beta.12) (2024-08-12) 145 | 146 | 147 | 148 | # [14.13.0-beta.12](https://github.com/leinelissen/embedded-postgres/compare/v13.16.0-beta.12...v14.13.0-beta.12) (2024-08-12) 149 | 150 | 151 | 152 | # [13.16.0-beta.12](https://github.com/leinelissen/embedded-postgres/compare/v12.20.0-beta.12...v13.16.0-beta.12) (2024-08-12) 153 | 154 | 155 | 156 | # [12.20.0-beta.12](https://github.com/leinelissen/embedded-postgres/compare/v16.2.0-beta.12...v12.20.0-beta.12) (2024-08-12) 157 | 158 | 159 | 160 | # [16.2.0-beta.12](https://github.com/leinelissen/embedded-postgres/compare/v15.6.0-beta.12...v16.2.0-beta.12) (2024-07-01) 161 | 162 | 163 | 164 | # [15.6.0-beta.12](https://github.com/leinelissen/embedded-postgres/compare/v14.11.0-beta.12...v15.6.0-beta.12) (2024-07-01) 165 | 166 | 167 | 168 | # [14.11.0-beta.12](https://github.com/leinelissen/embedded-postgres/compare/v13.14.0-beta.12...v14.11.0-beta.12) (2024-07-01) 169 | 170 | 171 | 172 | # [13.14.0-beta.12](https://github.com/leinelissen/embedded-postgres/compare/v12.18.0-beta.12...v13.14.0-beta.12) (2024-07-01) 173 | 174 | 175 | 176 | # [12.18.0-beta.12](https://github.com/leinelissen/embedded-postgres/compare/v16.2.0-beta.11...v12.18.0-beta.12) (2024-07-01) 177 | 178 | 179 | ### Bug Fixes 180 | 181 | * esm updates ([3e85055](https://github.com/leinelissen/embedded-postgres/commit/3e85055bc52774984fbf391b6ce0446d4ae99374)), closes [#12](https://github.com/leinelissen/embedded-postgres/issues/12) 182 | 183 | 184 | 185 | # [16.2.0-beta.11](https://github.com/leinelissen/embedded-postgres/compare/v15.6.0-beta.11...v16.2.0-beta.11) (2024-02-11) 186 | 187 | 188 | 189 | # [15.6.0-beta.11](https://github.com/leinelissen/embedded-postgres/compare/v14.11.0-beta.11...v15.6.0-beta.11) (2024-02-11) 190 | 191 | 192 | 193 | # [14.11.0-beta.11](https://github.com/leinelissen/embedded-postgres/compare/v13.14.0-beta.11...v14.11.0-beta.11) (2024-02-11) 194 | 195 | 196 | 197 | # [13.14.0-beta.11](https://github.com/leinelissen/embedded-postgres/compare/v12.18.0-beta.11...v13.14.0-beta.11) (2024-02-11) 198 | 199 | 200 | 201 | # [12.18.0-beta.11](https://github.com/leinelissen/embedded-postgres/compare/v16.1.1-beta.11...v12.18.0-beta.11) (2024-02-11) 202 | 203 | 204 | 205 | ## [16.1.1-beta.11](https://github.com/leinelissen/embedded-postgres/compare/v15.5.1-beta.11...v16.1.1-beta.11) (2024-02-11) 206 | 207 | 208 | 209 | ## [15.5.1-beta.11](https://github.com/leinelissen/embedded-postgres/compare/v14.10.1-beta.11...v15.5.1-beta.11) (2024-02-11) 210 | 211 | 212 | 213 | ## [14.10.1-beta.11](https://github.com/leinelissen/embedded-postgres/compare/v13.13.1-beta.11...v14.10.1-beta.11) (2024-02-11) 214 | 215 | 216 | 217 | ## [13.13.1-beta.11](https://github.com/leinelissen/embedded-postgres/compare/v12.17.1-beta.11...v13.13.1-beta.11) (2024-02-11) 218 | 219 | 220 | 221 | ## [12.17.1-beta.11](https://github.com/leinelissen/embedded-postgres/compare/v11.22.1-beta.11...v12.17.1-beta.11) (2024-02-11) 222 | 223 | 224 | 225 | ## [11.22.1-beta.11](https://github.com/leinelissen/embedded-postgres/compare/v16.1.1-beta.10...v11.22.1-beta.11) (2024-02-11) 226 | 227 | 228 | ### Bug Fixes 229 | 230 | * properly pass the --all flag to the downloader script ([4d29814](https://github.com/leinelissen/embedded-postgres/commit/4d29814c120fe13bb8f76754ed2740e76eb5ac37)) 231 | 232 | 233 | 234 | ## [16.1.1-beta.10](https://github.com/leinelissen/embedded-postgres/compare/v15.5.1-beta.10...v16.1.1-beta.10) (2024-02-11) 235 | 236 | 237 | 238 | ## [15.5.1-beta.10](https://github.com/leinelissen/embedded-postgres/compare/v14.10.1-beta.10...v15.5.1-beta.10) (2024-02-11) 239 | 240 | 241 | 242 | ## [14.10.1-beta.10](https://github.com/leinelissen/embedded-postgres/compare/v13.13.1-beta.10...v14.10.1-beta.10) (2024-02-11) 243 | 244 | 245 | 246 | ## [13.13.1-beta.10](https://github.com/leinelissen/embedded-postgres/compare/v12.17.1-beta.10...v13.13.1-beta.10) (2024-02-11) 247 | 248 | 249 | 250 | ## [12.17.1-beta.10](https://github.com/leinelissen/embedded-postgres/compare/v11.22.1-beta.10...v12.17.1-beta.10) (2024-02-11) 251 | 252 | 253 | 254 | ## [11.22.1-beta.10](https://github.com/leinelissen/embedded-postgres/compare/v16.1.1-beta.9...v11.22.1-beta.10) (2024-02-11) 255 | 256 | 257 | ### Bug Fixes 258 | 259 | * add missing semicolon ([427388d](https://github.com/leinelissen/embedded-postgres/commit/427388dfb7fe2fdf306839dc4b5fc13579290455)) 260 | * allow proper shutdown of postgres process on windows as well ([92fb102](https://github.com/leinelissen/embedded-postgres/commit/92fb1020cf877aa01198fe2dda0bd55ce39394d6)) 261 | * catch errors when reading symlinks file so devs can download binaries first ([89852c9](https://github.com/leinelissen/embedded-postgres/commit/89852c945a49a80c1b445c2818afbda72e3e7c2d)) 262 | * don't run pg commands in shells ([0987bec](https://github.com/leinelissen/embedded-postgres/commit/0987becc7dfd46d66e9102f3479d96611be441f5)) 263 | * enable binary downloads on win32 ([2493d29](https://github.com/leinelissen/embedded-postgres/commit/2493d2995e0a37d3cc0917c45d84a0ad173515aa)) 264 | * only remove native.tar when it exists ([a70556e](https://github.com/leinelissen/embedded-postgres/commit/a70556ed56e47873fe6697fb5c7c7e2a8c14be8c)) 265 | * refactor download scripts to ESM as well ([557bff7](https://github.com/leinelissen/embedded-postgres/commit/557bff7ac25cdb210530d2d6b08002aa8af4c163)) 266 | * replace "with" syntax for "assert" syntax for broader node compatibility ([bf98824](https://github.com/leinelissen/embedded-postgres/commit/bf9882407d176976898ed5113f721586a8a0a681)) 267 | * run tar in one go on non-windows systems ([eac6820](https://github.com/leinelissen/embedded-postgres/commit/eac6820a26bca54fa54e8113c403a46e2d012b99)) 268 | 269 | 270 | ### Features 271 | 272 | * refactor to ESM ([c5299bb](https://github.com/leinelissen/embedded-postgres/commit/c5299bb204cb2c1c19ee76aed8c90583ad3dfd16)) 273 | 274 | 275 | 276 | ## [16.1.1-beta.9](https://github.com/leinelissen/embedded-postgres/compare/v15.5.1-beta.9...v16.1.1-beta.9) (2023-12-07) 277 | 278 | 279 | 280 | ## [15.5.1-beta.9](https://github.com/leinelissen/embedded-postgres/compare/v14.10.1-beta.9...v15.5.1-beta.9) (2023-12-07) 281 | 282 | 283 | 284 | ## [14.10.1-beta.9](https://github.com/leinelissen/embedded-postgres/compare/v13.13.1-beta.9...v14.10.1-beta.9) (2023-12-07) 285 | 286 | 287 | 288 | ## [13.13.1-beta.9](https://github.com/leinelissen/embedded-postgres/compare/v12.17.1-beta.9...v13.13.1-beta.9) (2023-12-07) 289 | 290 | 291 | 292 | ## [12.17.1-beta.9](https://github.com/leinelissen/embedded-postgres/compare/v11.22.1-beta.9...v12.17.1-beta.9) (2023-12-07) 293 | 294 | 295 | 296 | ## [11.22.1-beta.9](https://github.com/leinelissen/embedded-postgres/compare/v15.4.0-beta.9...v11.22.1-beta.9) (2023-12-07) 297 | 298 | 299 | 300 | # [15.4.0-beta.9](https://github.com/leinelissen/embedded-postgres/compare/v14.9.0-beta.9...v15.4.0-beta.9) (2023-08-25) 301 | 302 | 303 | 304 | # [14.9.0-beta.9](https://github.com/leinelissen/embedded-postgres/compare/v13.12.0-beta.9...v14.9.0-beta.9) (2023-08-25) 305 | 306 | 307 | 308 | # [13.12.0-beta.9](https://github.com/leinelissen/embedded-postgres/compare/v12.16.0-beta.9...v13.12.0-beta.9) (2023-08-25) 309 | 310 | 311 | 312 | # [12.16.0-beta.9](https://github.com/leinelissen/embedded-postgres/compare/v11.21.0-beta.9...v12.16.0-beta.9) (2023-08-25) 313 | 314 | 315 | 316 | # [11.21.0-beta.9](https://github.com/leinelissen/embedded-postgres/compare/v15.3.0-beta.9...v11.21.0-beta.9) (2023-08-25) 317 | 318 | 319 | 320 | # [15.3.0-beta.9](https://github.com/leinelissen/embedded-postgres/compare/v14.8.0-beta.9...v15.3.0-beta.9) (2023-07-11) 321 | 322 | 323 | 324 | # [14.8.0-beta.9](https://github.com/leinelissen/embedded-postgres/compare/v13.11.0-beta.9...v14.8.0-beta.9) (2023-07-11) 325 | 326 | 327 | 328 | # [13.11.0-beta.9](https://github.com/leinelissen/embedded-postgres/compare/v12.15.0-beta.9...v13.11.0-beta.9) (2023-07-11) 329 | 330 | 331 | 332 | # [12.15.0-beta.9](https://github.com/leinelissen/embedded-postgres/compare/v11.20.0-beta.9...v12.15.0-beta.9) (2023-07-11) 333 | 334 | 335 | 336 | # [11.20.0-beta.9](https://github.com/leinelissen/embedded-postgres/compare/v15.3.0-beta.8...v11.20.0-beta.9) (2023-07-11) 337 | 338 | 339 | ### Bug Fixes 340 | 341 | * camelCase instead of snake_case ([5bb4243](https://github.com/leinelissen/embedded-postgres/commit/5bb42438b578acd2508ec42c27af27b3d1de679b)) 342 | 343 | 344 | ### Features 345 | 346 | * add option for automatically creating postgres user ([f0d859c](https://github.com/leinelissen/embedded-postgres/commit/f0d859caf9ac2596d6524a613c21506aae3a3369)) 347 | * allow injecting postgres and initdb flags ([09ab2ee](https://github.com/leinelissen/embedded-postgres/commit/09ab2ee2b603c9e1376a5241a17a77d8ec651645)) 348 | * allow specifying error handlers ([56f696b](https://github.com/leinelissen/embedded-postgres/commit/56f696b85213a1c783bd024cfa49d0ddbc8b86da)) 349 | 350 | 351 | 352 | # [15.3.0-beta.8](https://github.com/leinelissen/embedded-postgres/compare/v14.8.0-beta.8...v15.3.0-beta.8) (2023-05-22) 353 | 354 | 355 | 356 | # [14.8.0-beta.8](https://github.com/leinelissen/embedded-postgres/compare/v13.11.0-beta.8...v14.8.0-beta.8) (2023-05-22) 357 | 358 | 359 | 360 | # [13.11.0-beta.8](https://github.com/leinelissen/embedded-postgres/compare/v12.15.0-beta.8...v13.11.0-beta.8) (2023-05-22) 361 | 362 | 363 | 364 | # [12.15.0-beta.8](https://github.com/leinelissen/embedded-postgres/compare/v11.20.0-beta.8...v12.15.0-beta.8) (2023-05-22) 365 | 366 | 367 | 368 | # [11.20.0-beta.8](https://github.com/leinelissen/embedded-postgres/compare/v15.3.0-beta.7...v11.20.0-beta.8) (2023-05-22) 369 | 370 | 371 | ### Bug Fixes 372 | 373 | * remove directory before unpacking tar ([19f21a9](https://github.com/leinelissen/embedded-postgres/commit/19f21a930d7b237ade404a49bbe98c5e5328033f)), closes [#3](https://github.com/leinelissen/embedded-postgres/issues/3) 374 | 375 | 376 | 377 | # [15.3.0-beta.7](https://github.com/leinelissen/embedded-postgres/compare/v14.8.0-beta.7...v15.3.0-beta.7) (2023-05-22) 378 | 379 | 380 | 381 | # [14.8.0-beta.7](https://github.com/leinelissen/embedded-postgres/compare/v13.11.0-beta.7...v14.8.0-beta.7) (2023-05-22) 382 | 383 | 384 | 385 | # [13.11.0-beta.7](https://github.com/leinelissen/embedded-postgres/compare/v12.15.0-beta.7...v13.11.0-beta.7) (2023-05-22) 386 | 387 | 388 | 389 | # [12.15.0-beta.7](https://github.com/leinelissen/embedded-postgres/compare/v11.20.0-beta.7...v12.15.0-beta.7) (2023-05-22) 390 | 391 | 392 | 393 | # [11.20.0-beta.7](https://github.com/leinelissen/embedded-postgres/compare/v14.7.0-beta.7...v11.20.0-beta.7) (2023-05-22) 394 | 395 | 396 | 397 | # [14.7.0-beta.7](https://github.com/leinelissen/embedded-postgres/compare/v13.10.0-beta.7...v14.7.0-beta.7) (2023-04-13) 398 | 399 | 400 | 401 | # [13.10.0-beta.7](https://github.com/leinelissen/embedded-postgres/compare/v12.14.0-beta.7...v13.10.0-beta.7) (2023-04-13) 402 | 403 | 404 | 405 | # [12.14.0-beta.7](https://github.com/leinelissen/embedded-postgres/compare/v11.19.0-beta.7...v12.14.0-beta.7) (2023-04-13) 406 | 407 | 408 | 409 | # [11.19.0-beta.7](https://github.com/leinelissen/embedded-postgres/compare/v15.2.0-beta.6...v11.19.0-beta.7) (2023-04-13) 410 | 411 | 412 | ### Bug Fixes 413 | 414 | * format exports so that tsc will acutally compile them to cjs ([8374696](https://github.com/leinelissen/embedded-postgres/commit/8374696eca4df5f9a0a7d17090db6a82d4bfda81)) 415 | 416 | 417 | 418 | # [15.2.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v14.7.0-beta.6...v15.2.0-beta.6) (2023-02-28) 419 | 420 | 421 | 422 | # [14.7.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v13.10.0-beta.6...v14.7.0-beta.6) (2023-02-28) 423 | 424 | 425 | 426 | # [13.10.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v12.14.0-beta.6...v13.10.0-beta.6) (2023-02-28) 427 | 428 | 429 | 430 | # [12.14.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v11.19.0-beta.6...v12.14.0-beta.6) (2023-02-28) 431 | 432 | 433 | 434 | # [11.19.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v15.1.0-beta.6...v11.19.0-beta.6) (2023-02-28) 435 | 436 | 437 | 438 | # [15.1.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v14.6.0-beta.6...v15.1.0-beta.6) (2022-11-25) 439 | 440 | 441 | 442 | # [14.6.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v13.9.0-beta.6...v14.6.0-beta.6) (2022-11-25) 443 | 444 | 445 | 446 | # [13.9.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v12.13.0-beta.6...v13.9.0-beta.6) (2022-11-25) 447 | 448 | 449 | 450 | # [12.13.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v11.18.0-beta.6...v12.13.0-beta.6) (2022-11-25) 451 | 452 | 453 | 454 | # [11.18.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v10.23.0-beta.6...v11.18.0-beta.6) (2022-11-25) 455 | 456 | 457 | 458 | # [10.23.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v15.0.0-beta.6...v10.23.0-beta.6) (2022-11-25) 459 | 460 | 461 | ### Bug Fixes 462 | 463 | * Also don't version and publish packages that are ignored ([95dfbaa](https://github.com/leinelissen/embedded-postgres/commit/95dfbaa33b2e7e0345c12a7453b49ecdf8bee952)) 464 | * Increment supported versions. Also disable releases pre-14 for darwin-arm64 ([60773f2](https://github.com/leinelissen/embedded-postgres/commit/60773f271c56a4bf8823d0f80e31508a486a1223)) 465 | 466 | 467 | ### Features 468 | 469 | * Create scripts for releasing multiple versions ([87faf4e](https://github.com/leinelissen/embedded-postgres/commit/87faf4edc6de75bd8043bb6be731ebc05c95747b)) 470 | 471 | 472 | ### Reverts 473 | 474 | * Revert "v10.23.0-beta.6" ([d101969](https://github.com/leinelissen/embedded-postgres/commit/d101969d704dc95d9b1b348f15e6b2b02658990b)) 475 | 476 | 477 | 478 | # [15.0.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v14.5.0-beta.6...v15.0.0-beta.6) (2022-11-01) 479 | 480 | 481 | 482 | # [14.5.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v14.4.0-beta.6...v14.5.0-beta.6) (2022-11-01) 483 | 484 | 485 | 486 | # [14.4.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-beta.6...v14.4.0-beta.6) (2022-11-01) 487 | 488 | 489 | 490 | # [14.3.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v13.6.0-beta.6...v14.3.0-beta.6) (2022-11-01) 491 | 492 | 493 | 494 | # [13.6.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v12.10.0-beta.6...v13.6.0-beta.6) (2022-11-01) 495 | 496 | 497 | 498 | # [12.10.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v11.15.0-beta.6...v12.10.0-beta.6) (2022-11-01) 499 | 500 | 501 | 502 | # [11.15.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v10.20.0-beta.6...v11.15.0-beta.6) (2022-11-01) 503 | 504 | 505 | 506 | # [10.20.0-beta.6](https://github.com/leinelissen/embedded-postgres/compare/v10.20.0-beta.5...v10.20.0-beta.6) (2022-11-01) 507 | 508 | 509 | 510 | # [10.20.0-beta.5](https://github.com/leinelissen/embedded-postgres/compare/v10.20.0-beta.3...v10.20.0-beta.5) (2022-11-01) 511 | 512 | 513 | 514 | # [10.20.0-beta.3](https://github.com/leinelissen/embedded-postgres/compare/v10.20.0-beta.2...v10.20.0-beta.3) (2022-11-01) 515 | 516 | 517 | 518 | # [10.20.0-beta.2](https://github.com/leinelissen/embedded-postgres/compare/v10.20.0-beta.1...v10.20.0-beta.2) (2022-11-01) 519 | 520 | 521 | 522 | # [10.20.0-beta.1](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.21...v10.20.0-beta.1) (2022-11-01) 523 | 524 | 525 | ### Bug Fixes 526 | 527 | * ignore .txz archives ([aded4af](https://github.com/leinelissen/embedded-postgres/commit/aded4aff2fa5d7c9acdb8cc366f4d331302b6f8e)) 528 | * map platforms as well, so that win32 is transformed into windows ([c038424](https://github.com/leinelissen/embedded-postgres/commit/c03842411141fb472ac3528390e26c654f4155ed)) 529 | 530 | 531 | 532 | # [14.3.0-alpha.21](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.20...v14.3.0-alpha.21) (2022-07-22) 533 | 534 | 535 | ### Bug Fixes 536 | 537 | * bump ([545718e](https://github.com/leinelissen/embedded-postgres/commit/545718e3528564b98c6c69d36334a5cbb62c09c2)) 538 | 539 | 540 | 541 | # [14.3.0-alpha.20](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.19...v14.3.0-alpha.20) (2022-07-22) 542 | 543 | 544 | ### Bug Fixes 545 | 546 | * append .exe to windows binaries ([3fe1731](https://github.com/leinelissen/embedded-postgres/commit/3fe1731b580648ff57eca28be1d0e003aa3d4be0)) 547 | 548 | 549 | 550 | # [14.3.0-alpha.19](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.18...v14.3.0-alpha.19) (2022-07-22) 551 | 552 | 553 | ### Bug Fixes 554 | 555 | * adjust package.json os string to win32 rather than windows ([4ce8819](https://github.com/leinelissen/embedded-postgres/commit/4ce8819c11751cc4e6c9bbadc9c1ad099ca9cc71)) 556 | 557 | 558 | 559 | # [14.3.0-alpha.18](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.17...v14.3.0-alpha.18) (2022-07-20) 560 | 561 | 562 | ### Bug Fixes 563 | 564 | * also chmod postgres binary on init ([3a376e8](https://github.com/leinelissen/embedded-postgres/commit/3a376e88f245968ec745e0cc3a42e7ca090c67e7)) 565 | 566 | 567 | 568 | # [14.3.0-alpha.17](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.16...v14.3.0-alpha.17) (2022-07-20) 569 | 570 | 571 | ### Bug Fixes 572 | 573 | * spelling ([d052d0d](https://github.com/leinelissen/embedded-postgres/commit/d052d0dc0ee85a503994ad9c63d230d07d10498c)) 574 | 575 | 576 | 577 | # [14.3.0-alpha.16](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.15...v14.3.0-alpha.16) (2022-07-20) 578 | 579 | 580 | 581 | # [14.3.0-alpha.15](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.14...v14.3.0-alpha.15) (2022-07-20) 582 | 583 | 584 | ### Bug Fixes 585 | 586 | * change permission to 755 from 744 ([520531b](https://github.com/leinelissen/embedded-postgres/commit/520531bceb3128f422f44447b31ff292465c4716)) 587 | 588 | 589 | 590 | # [14.3.0-alpha.14](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.13...v14.3.0-alpha.14) (2022-07-20) 591 | 592 | 593 | ### Features 594 | 595 | * Greedily chmod executables ([1ab4735](https://github.com/leinelissen/embedded-postgres/commit/1ab4735a61a8bcd7827660016a40024ee5aaadf3)) 596 | 597 | 598 | 599 | # [14.3.0-alpha.13](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.12...v14.3.0-alpha.13) (2022-07-20) 600 | 601 | 602 | ### Features 603 | 604 | * Also make package available for Windows and Linux ([5cfb7f3](https://github.com/leinelissen/embedded-postgres/commit/5cfb7f33835e545534eab741b7a7c59593e6370c)) 605 | 606 | 607 | 608 | # [14.3.0-alpha.12](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.11...v14.3.0-alpha.12) (2022-06-16) 609 | 610 | 611 | ### Bug Fixes 612 | 613 | * Make symlinks relative to their containing folder rather than the package root ([c5eda7d](https://github.com/leinelissen/embedded-postgres/commit/c5eda7d4f058ab3e0ec67275b9c8664d955dea1e)) 614 | * Remove last instance of fs.link ([c2dae1a](https://github.com/leinelissen/embedded-postgres/commit/c2dae1a00759584c41aaed6dc6880a7e1bc224d3)) 615 | 616 | 617 | ### Features 618 | 619 | * Allow specific version to be specified when downloading postgres ([73532c0](https://github.com/leinelissen/embedded-postgres/commit/73532c06314b96e489028839e192a5d02ee49f42)) 620 | 621 | 622 | 623 | # [14.3.0-alpha.11](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.10...v14.3.0-alpha.11) (2022-06-14) 624 | 625 | 626 | ### Bug Fixes 627 | 628 | * Replace fs.link with fs.symlink ([91b9266](https://github.com/leinelissen/embedded-postgres/commit/91b926633aeca5ec332a715925b72875fe37931d)) 629 | 630 | 631 | 632 | # [14.3.0-alpha.10](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.9...v14.3.0-alpha.10) (2022-06-14) 633 | 634 | 635 | ### Bug Fixes 636 | 637 | * Also pack postinstalls script ([033619f](https://github.com/leinelissen/embedded-postgres/commit/033619fb4c3e1edf021a5b74823d7b0cc6b84fdc)) 638 | 639 | 640 | 641 | # [14.3.0-alpha.9](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.8...v14.3.0-alpha.9) (2022-06-14) 642 | 643 | 644 | ### Features 645 | 646 | * Detect and hydrate symlinks from now on ([c61844a](https://github.com/leinelissen/embedded-postgres/commit/c61844ad680a12ac08f2b8ce7d89e21f4013ffd4)) 647 | 648 | 649 | 650 | # [14.3.0-alpha.8](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.7...v14.3.0-alpha.8) (2022-06-08) 651 | 652 | 653 | 654 | # [14.3.0-alpha.7](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.6...v14.3.0-alpha.7) (2022-06-08) 655 | 656 | 657 | 658 | # [14.3.0-alpha.6](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.4...v14.3.0-alpha.6) (2022-06-08) 659 | 660 | 661 | 662 | # [14.3.0-alpha.4](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.3...v14.3.0-alpha.4) (2022-06-08) 663 | 664 | 665 | 666 | # [14.3.0-alpha.3](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.2...v14.3.0-alpha.3) (2022-06-08) 667 | 668 | 669 | 670 | # [14.3.0-alpha.2](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0-alpha.1...v14.3.0-alpha.2) (2022-06-08) 671 | 672 | 673 | 674 | # [14.3.0-alpha.1](https://github.com/leinelissen/embedded-postgres/compare/v14.3.0...v14.3.0-alpha.1) (2022-06-08) 675 | 676 | 677 | 678 | # 14.3.0 (2022-06-08) 679 | 680 | 681 | 682 | -------------------------------------------------------------------------------- /packages/linux-arm/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@embedded-postgres/linux-arm", 3 | "version": "18.1.0-beta.15", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "@embedded-postgres/linux-arm", 9 | "version": "14.3.0", 10 | "cpu": [ 11 | "arm" 12 | ], 13 | "license": "MIT", 14 | "os": [ 15 | "linux" 16 | ], 17 | "devDependencies": { 18 | "@embedded-postgres/downloader": "^14.3.0" 19 | } 20 | }, 21 | "../downloader": { 22 | "name": "@embedded-postgres/downloader", 23 | "version": "14.3.0", 24 | "dev": true, 25 | "license": "MIT", 26 | "dependencies": { 27 | "adm-zip": "^0.5.9", 28 | "node-fetch": "^2.6.7" 29 | }, 30 | "devDependencies": { 31 | "@types/adm-zip": "^0.5.0", 32 | "@types/node-fetch": "^2.6.1", 33 | "@types/tar": "^6.1.1", 34 | "eslint": "^8.17.0", 35 | "typescript": "^4.7.3" 36 | } 37 | }, 38 | "../downloader/node_modules/@eslint/eslintrc": { 39 | "version": "1.3.0", 40 | "dev": true, 41 | "license": "MIT", 42 | "dependencies": { 43 | "ajv": "^6.12.4", 44 | "debug": "^4.3.2", 45 | "espree": "^9.3.2", 46 | "globals": "^13.15.0", 47 | "ignore": "^5.2.0", 48 | "import-fresh": "^3.2.1", 49 | "js-yaml": "^4.1.0", 50 | "minimatch": "^3.1.2", 51 | "strip-json-comments": "^3.1.1" 52 | }, 53 | "engines": { 54 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 55 | } 56 | }, 57 | "../downloader/node_modules/@humanwhocodes/config-array": { 58 | "version": "0.9.5", 59 | "dev": true, 60 | "license": "Apache-2.0", 61 | "dependencies": { 62 | "@humanwhocodes/object-schema": "^1.2.1", 63 | "debug": "^4.1.1", 64 | "minimatch": "^3.0.4" 65 | }, 66 | "engines": { 67 | "node": ">=10.10.0" 68 | } 69 | }, 70 | "../downloader/node_modules/@humanwhocodes/object-schema": { 71 | "version": "1.2.1", 72 | "dev": true, 73 | "license": "BSD-3-Clause" 74 | }, 75 | "../downloader/node_modules/@types/adm-zip": { 76 | "version": "0.5.0", 77 | "dev": true, 78 | "license": "MIT", 79 | "dependencies": { 80 | "@types/node": "*" 81 | } 82 | }, 83 | "../downloader/node_modules/@types/minipass": { 84 | "version": "3.1.2", 85 | "dev": true, 86 | "license": "MIT", 87 | "dependencies": { 88 | "@types/node": "*" 89 | } 90 | }, 91 | "../downloader/node_modules/@types/node": { 92 | "version": "17.0.40", 93 | "dev": true, 94 | "license": "MIT" 95 | }, 96 | "../downloader/node_modules/@types/node-fetch": { 97 | "version": "2.6.1", 98 | "dev": true, 99 | "license": "MIT", 100 | "dependencies": { 101 | "@types/node": "*", 102 | "form-data": "^3.0.0" 103 | } 104 | }, 105 | "../downloader/node_modules/@types/tar": { 106 | "version": "6.1.1", 107 | "dev": true, 108 | "license": "MIT", 109 | "dependencies": { 110 | "@types/minipass": "*", 111 | "@types/node": "*" 112 | } 113 | }, 114 | "../downloader/node_modules/acorn": { 115 | "version": "8.7.1", 116 | "dev": true, 117 | "license": "MIT", 118 | "bin": { 119 | "acorn": "bin/acorn" 120 | }, 121 | "engines": { 122 | "node": ">=0.4.0" 123 | } 124 | }, 125 | "../downloader/node_modules/acorn-jsx": { 126 | "version": "5.3.2", 127 | "dev": true, 128 | "license": "MIT", 129 | "peerDependencies": { 130 | "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" 131 | } 132 | }, 133 | "../downloader/node_modules/adm-zip": { 134 | "version": "0.5.9", 135 | "dev": true, 136 | "license": "MIT", 137 | "engines": { 138 | "node": ">=6.0" 139 | } 140 | }, 141 | "../downloader/node_modules/ajv": { 142 | "version": "6.12.6", 143 | "dev": true, 144 | "license": "MIT", 145 | "dependencies": { 146 | "fast-deep-equal": "^3.1.1", 147 | "fast-json-stable-stringify": "^2.0.0", 148 | "json-schema-traverse": "^0.4.1", 149 | "uri-js": "^4.2.2" 150 | }, 151 | "funding": { 152 | "type": "github", 153 | "url": "https://github.com/sponsors/epoberezkin" 154 | } 155 | }, 156 | "../downloader/node_modules/ansi-regex": { 157 | "version": "5.0.1", 158 | "dev": true, 159 | "license": "MIT", 160 | "engines": { 161 | "node": ">=8" 162 | } 163 | }, 164 | "../downloader/node_modules/ansi-styles": { 165 | "version": "4.3.0", 166 | "dev": true, 167 | "license": "MIT", 168 | "dependencies": { 169 | "color-convert": "^2.0.1" 170 | }, 171 | "engines": { 172 | "node": ">=8" 173 | }, 174 | "funding": { 175 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 176 | } 177 | }, 178 | "../downloader/node_modules/argparse": { 179 | "version": "2.0.1", 180 | "dev": true, 181 | "license": "Python-2.0" 182 | }, 183 | "../downloader/node_modules/asynckit": { 184 | "version": "0.4.0", 185 | "dev": true, 186 | "license": "MIT" 187 | }, 188 | "../downloader/node_modules/balanced-match": { 189 | "version": "1.0.2", 190 | "dev": true, 191 | "license": "MIT" 192 | }, 193 | "../downloader/node_modules/brace-expansion": { 194 | "version": "1.1.11", 195 | "dev": true, 196 | "license": "MIT", 197 | "dependencies": { 198 | "balanced-match": "^1.0.0", 199 | "concat-map": "0.0.1" 200 | } 201 | }, 202 | "../downloader/node_modules/callsites": { 203 | "version": "3.1.0", 204 | "dev": true, 205 | "license": "MIT", 206 | "engines": { 207 | "node": ">=6" 208 | } 209 | }, 210 | "../downloader/node_modules/chalk": { 211 | "version": "4.1.2", 212 | "dev": true, 213 | "license": "MIT", 214 | "dependencies": { 215 | "ansi-styles": "^4.1.0", 216 | "supports-color": "^7.1.0" 217 | }, 218 | "engines": { 219 | "node": ">=10" 220 | }, 221 | "funding": { 222 | "url": "https://github.com/chalk/chalk?sponsor=1" 223 | } 224 | }, 225 | "../downloader/node_modules/color-convert": { 226 | "version": "2.0.1", 227 | "dev": true, 228 | "license": "MIT", 229 | "dependencies": { 230 | "color-name": "~1.1.4" 231 | }, 232 | "engines": { 233 | "node": ">=7.0.0" 234 | } 235 | }, 236 | "../downloader/node_modules/color-name": { 237 | "version": "1.1.4", 238 | "dev": true, 239 | "license": "MIT" 240 | }, 241 | "../downloader/node_modules/combined-stream": { 242 | "version": "1.0.8", 243 | "dev": true, 244 | "license": "MIT", 245 | "dependencies": { 246 | "delayed-stream": "~1.0.0" 247 | }, 248 | "engines": { 249 | "node": ">= 0.8" 250 | } 251 | }, 252 | "../downloader/node_modules/concat-map": { 253 | "version": "0.0.1", 254 | "dev": true, 255 | "license": "MIT" 256 | }, 257 | "../downloader/node_modules/cross-spawn": { 258 | "version": "7.0.3", 259 | "dev": true, 260 | "license": "MIT", 261 | "dependencies": { 262 | "path-key": "^3.1.0", 263 | "shebang-command": "^2.0.0", 264 | "which": "^2.0.1" 265 | }, 266 | "engines": { 267 | "node": ">= 8" 268 | } 269 | }, 270 | "../downloader/node_modules/debug": { 271 | "version": "4.3.4", 272 | "dev": true, 273 | "license": "MIT", 274 | "dependencies": { 275 | "ms": "2.1.2" 276 | }, 277 | "engines": { 278 | "node": ">=6.0" 279 | }, 280 | "peerDependenciesMeta": { 281 | "supports-color": { 282 | "optional": true 283 | } 284 | } 285 | }, 286 | "../downloader/node_modules/deep-is": { 287 | "version": "0.1.4", 288 | "dev": true, 289 | "license": "MIT" 290 | }, 291 | "../downloader/node_modules/delayed-stream": { 292 | "version": "1.0.0", 293 | "dev": true, 294 | "license": "MIT", 295 | "engines": { 296 | "node": ">=0.4.0" 297 | } 298 | }, 299 | "../downloader/node_modules/doctrine": { 300 | "version": "3.0.0", 301 | "dev": true, 302 | "license": "Apache-2.0", 303 | "dependencies": { 304 | "esutils": "^2.0.2" 305 | }, 306 | "engines": { 307 | "node": ">=6.0.0" 308 | } 309 | }, 310 | "../downloader/node_modules/escape-string-regexp": { 311 | "version": "4.0.0", 312 | "dev": true, 313 | "license": "MIT", 314 | "engines": { 315 | "node": ">=10" 316 | }, 317 | "funding": { 318 | "url": "https://github.com/sponsors/sindresorhus" 319 | } 320 | }, 321 | "../downloader/node_modules/eslint": { 322 | "version": "8.17.0", 323 | "dev": true, 324 | "license": "MIT", 325 | "dependencies": { 326 | "@eslint/eslintrc": "^1.3.0", 327 | "@humanwhocodes/config-array": "^0.9.2", 328 | "ajv": "^6.10.0", 329 | "chalk": "^4.0.0", 330 | "cross-spawn": "^7.0.2", 331 | "debug": "^4.3.2", 332 | "doctrine": "^3.0.0", 333 | "escape-string-regexp": "^4.0.0", 334 | "eslint-scope": "^7.1.1", 335 | "eslint-utils": "^3.0.0", 336 | "eslint-visitor-keys": "^3.3.0", 337 | "espree": "^9.3.2", 338 | "esquery": "^1.4.0", 339 | "esutils": "^2.0.2", 340 | "fast-deep-equal": "^3.1.3", 341 | "file-entry-cache": "^6.0.1", 342 | "functional-red-black-tree": "^1.0.1", 343 | "glob-parent": "^6.0.1", 344 | "globals": "^13.15.0", 345 | "ignore": "^5.2.0", 346 | "import-fresh": "^3.0.0", 347 | "imurmurhash": "^0.1.4", 348 | "is-glob": "^4.0.0", 349 | "js-yaml": "^4.1.0", 350 | "json-stable-stringify-without-jsonify": "^1.0.1", 351 | "levn": "^0.4.1", 352 | "lodash.merge": "^4.6.2", 353 | "minimatch": "^3.1.2", 354 | "natural-compare": "^1.4.0", 355 | "optionator": "^0.9.1", 356 | "regexpp": "^3.2.0", 357 | "strip-ansi": "^6.0.1", 358 | "strip-json-comments": "^3.1.0", 359 | "text-table": "^0.2.0", 360 | "v8-compile-cache": "^2.0.3" 361 | }, 362 | "bin": { 363 | "eslint": "bin/eslint.js" 364 | }, 365 | "engines": { 366 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 367 | }, 368 | "funding": { 369 | "url": "https://opencollective.com/eslint" 370 | } 371 | }, 372 | "../downloader/node_modules/eslint-scope": { 373 | "version": "7.1.1", 374 | "dev": true, 375 | "license": "BSD-2-Clause", 376 | "dependencies": { 377 | "esrecurse": "^4.3.0", 378 | "estraverse": "^5.2.0" 379 | }, 380 | "engines": { 381 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 382 | } 383 | }, 384 | "../downloader/node_modules/eslint-utils": { 385 | "version": "3.0.0", 386 | "dev": true, 387 | "license": "MIT", 388 | "dependencies": { 389 | "eslint-visitor-keys": "^2.0.0" 390 | }, 391 | "engines": { 392 | "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" 393 | }, 394 | "funding": { 395 | "url": "https://github.com/sponsors/mysticatea" 396 | }, 397 | "peerDependencies": { 398 | "eslint": ">=5" 399 | } 400 | }, 401 | "../downloader/node_modules/eslint-utils/node_modules/eslint-visitor-keys": { 402 | "version": "2.1.0", 403 | "dev": true, 404 | "license": "Apache-2.0", 405 | "engines": { 406 | "node": ">=10" 407 | } 408 | }, 409 | "../downloader/node_modules/eslint-visitor-keys": { 410 | "version": "3.3.0", 411 | "dev": true, 412 | "license": "Apache-2.0", 413 | "engines": { 414 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 415 | } 416 | }, 417 | "../downloader/node_modules/espree": { 418 | "version": "9.3.2", 419 | "dev": true, 420 | "license": "BSD-2-Clause", 421 | "dependencies": { 422 | "acorn": "^8.7.1", 423 | "acorn-jsx": "^5.3.2", 424 | "eslint-visitor-keys": "^3.3.0" 425 | }, 426 | "engines": { 427 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 428 | } 429 | }, 430 | "../downloader/node_modules/esquery": { 431 | "version": "1.4.0", 432 | "dev": true, 433 | "license": "BSD-3-Clause", 434 | "dependencies": { 435 | "estraverse": "^5.1.0" 436 | }, 437 | "engines": { 438 | "node": ">=0.10" 439 | } 440 | }, 441 | "../downloader/node_modules/esrecurse": { 442 | "version": "4.3.0", 443 | "dev": true, 444 | "license": "BSD-2-Clause", 445 | "dependencies": { 446 | "estraverse": "^5.2.0" 447 | }, 448 | "engines": { 449 | "node": ">=4.0" 450 | } 451 | }, 452 | "../downloader/node_modules/estraverse": { 453 | "version": "5.3.0", 454 | "dev": true, 455 | "license": "BSD-2-Clause", 456 | "engines": { 457 | "node": ">=4.0" 458 | } 459 | }, 460 | "../downloader/node_modules/esutils": { 461 | "version": "2.0.3", 462 | "dev": true, 463 | "license": "BSD-2-Clause", 464 | "engines": { 465 | "node": ">=0.10.0" 466 | } 467 | }, 468 | "../downloader/node_modules/fast-deep-equal": { 469 | "version": "3.1.3", 470 | "dev": true, 471 | "license": "MIT" 472 | }, 473 | "../downloader/node_modules/fast-json-stable-stringify": { 474 | "version": "2.1.0", 475 | "dev": true, 476 | "license": "MIT" 477 | }, 478 | "../downloader/node_modules/fast-levenshtein": { 479 | "version": "2.0.6", 480 | "dev": true, 481 | "license": "MIT" 482 | }, 483 | "../downloader/node_modules/file-entry-cache": { 484 | "version": "6.0.1", 485 | "dev": true, 486 | "license": "MIT", 487 | "dependencies": { 488 | "flat-cache": "^3.0.4" 489 | }, 490 | "engines": { 491 | "node": "^10.12.0 || >=12.0.0" 492 | } 493 | }, 494 | "../downloader/node_modules/flat-cache": { 495 | "version": "3.0.4", 496 | "dev": true, 497 | "license": "MIT", 498 | "dependencies": { 499 | "flatted": "^3.1.0", 500 | "rimraf": "^3.0.2" 501 | }, 502 | "engines": { 503 | "node": "^10.12.0 || >=12.0.0" 504 | } 505 | }, 506 | "../downloader/node_modules/flatted": { 507 | "version": "3.2.5", 508 | "dev": true, 509 | "license": "ISC" 510 | }, 511 | "../downloader/node_modules/form-data": { 512 | "version": "3.0.1", 513 | "dev": true, 514 | "license": "MIT", 515 | "dependencies": { 516 | "asynckit": "^0.4.0", 517 | "combined-stream": "^1.0.8", 518 | "mime-types": "^2.1.12" 519 | }, 520 | "engines": { 521 | "node": ">= 6" 522 | } 523 | }, 524 | "../downloader/node_modules/fs.realpath": { 525 | "version": "1.0.0", 526 | "dev": true, 527 | "license": "ISC" 528 | }, 529 | "../downloader/node_modules/functional-red-black-tree": { 530 | "version": "1.0.1", 531 | "dev": true, 532 | "license": "MIT" 533 | }, 534 | "../downloader/node_modules/glob": { 535 | "version": "7.2.3", 536 | "dev": true, 537 | "license": "ISC", 538 | "dependencies": { 539 | "fs.realpath": "^1.0.0", 540 | "inflight": "^1.0.4", 541 | "inherits": "2", 542 | "minimatch": "^3.1.1", 543 | "once": "^1.3.0", 544 | "path-is-absolute": "^1.0.0" 545 | }, 546 | "engines": { 547 | "node": "*" 548 | }, 549 | "funding": { 550 | "url": "https://github.com/sponsors/isaacs" 551 | } 552 | }, 553 | "../downloader/node_modules/glob-parent": { 554 | "version": "6.0.2", 555 | "dev": true, 556 | "license": "ISC", 557 | "dependencies": { 558 | "is-glob": "^4.0.3" 559 | }, 560 | "engines": { 561 | "node": ">=10.13.0" 562 | } 563 | }, 564 | "../downloader/node_modules/globals": { 565 | "version": "13.15.0", 566 | "dev": true, 567 | "license": "MIT", 568 | "dependencies": { 569 | "type-fest": "^0.20.2" 570 | }, 571 | "engines": { 572 | "node": ">=8" 573 | }, 574 | "funding": { 575 | "url": "https://github.com/sponsors/sindresorhus" 576 | } 577 | }, 578 | "../downloader/node_modules/has-flag": { 579 | "version": "4.0.0", 580 | "dev": true, 581 | "license": "MIT", 582 | "engines": { 583 | "node": ">=8" 584 | } 585 | }, 586 | "../downloader/node_modules/ignore": { 587 | "version": "5.2.0", 588 | "dev": true, 589 | "license": "MIT", 590 | "engines": { 591 | "node": ">= 4" 592 | } 593 | }, 594 | "../downloader/node_modules/import-fresh": { 595 | "version": "3.3.0", 596 | "dev": true, 597 | "license": "MIT", 598 | "dependencies": { 599 | "parent-module": "^1.0.0", 600 | "resolve-from": "^4.0.0" 601 | }, 602 | "engines": { 603 | "node": ">=6" 604 | }, 605 | "funding": { 606 | "url": "https://github.com/sponsors/sindresorhus" 607 | } 608 | }, 609 | "../downloader/node_modules/imurmurhash": { 610 | "version": "0.1.4", 611 | "dev": true, 612 | "license": "MIT", 613 | "engines": { 614 | "node": ">=0.8.19" 615 | } 616 | }, 617 | "../downloader/node_modules/inflight": { 618 | "version": "1.0.6", 619 | "dev": true, 620 | "license": "ISC", 621 | "dependencies": { 622 | "once": "^1.3.0", 623 | "wrappy": "1" 624 | } 625 | }, 626 | "../downloader/node_modules/inherits": { 627 | "version": "2.0.4", 628 | "dev": true, 629 | "license": "ISC" 630 | }, 631 | "../downloader/node_modules/is-extglob": { 632 | "version": "2.1.1", 633 | "dev": true, 634 | "license": "MIT", 635 | "engines": { 636 | "node": ">=0.10.0" 637 | } 638 | }, 639 | "../downloader/node_modules/is-glob": { 640 | "version": "4.0.3", 641 | "dev": true, 642 | "license": "MIT", 643 | "dependencies": { 644 | "is-extglob": "^2.1.1" 645 | }, 646 | "engines": { 647 | "node": ">=0.10.0" 648 | } 649 | }, 650 | "../downloader/node_modules/isexe": { 651 | "version": "2.0.0", 652 | "dev": true, 653 | "license": "ISC" 654 | }, 655 | "../downloader/node_modules/js-yaml": { 656 | "version": "4.1.0", 657 | "dev": true, 658 | "license": "MIT", 659 | "dependencies": { 660 | "argparse": "^2.0.1" 661 | }, 662 | "bin": { 663 | "js-yaml": "bin/js-yaml.js" 664 | } 665 | }, 666 | "../downloader/node_modules/json-schema-traverse": { 667 | "version": "0.4.1", 668 | "dev": true, 669 | "license": "MIT" 670 | }, 671 | "../downloader/node_modules/json-stable-stringify-without-jsonify": { 672 | "version": "1.0.1", 673 | "dev": true, 674 | "license": "MIT" 675 | }, 676 | "../downloader/node_modules/levn": { 677 | "version": "0.4.1", 678 | "dev": true, 679 | "license": "MIT", 680 | "dependencies": { 681 | "prelude-ls": "^1.2.1", 682 | "type-check": "~0.4.0" 683 | }, 684 | "engines": { 685 | "node": ">= 0.8.0" 686 | } 687 | }, 688 | "../downloader/node_modules/lodash.merge": { 689 | "version": "4.6.2", 690 | "dev": true, 691 | "license": "MIT" 692 | }, 693 | "../downloader/node_modules/mime-db": { 694 | "version": "1.52.0", 695 | "dev": true, 696 | "license": "MIT", 697 | "engines": { 698 | "node": ">= 0.6" 699 | } 700 | }, 701 | "../downloader/node_modules/mime-types": { 702 | "version": "2.1.35", 703 | "dev": true, 704 | "license": "MIT", 705 | "dependencies": { 706 | "mime-db": "1.52.0" 707 | }, 708 | "engines": { 709 | "node": ">= 0.6" 710 | } 711 | }, 712 | "../downloader/node_modules/minimatch": { 713 | "version": "3.1.2", 714 | "dev": true, 715 | "license": "ISC", 716 | "dependencies": { 717 | "brace-expansion": "^1.1.7" 718 | }, 719 | "engines": { 720 | "node": "*" 721 | } 722 | }, 723 | "../downloader/node_modules/ms": { 724 | "version": "2.1.2", 725 | "dev": true, 726 | "license": "MIT" 727 | }, 728 | "../downloader/node_modules/natural-compare": { 729 | "version": "1.4.0", 730 | "dev": true, 731 | "license": "MIT" 732 | }, 733 | "../downloader/node_modules/node-fetch": { 734 | "version": "2.6.7", 735 | "dev": true, 736 | "license": "MIT", 737 | "dependencies": { 738 | "whatwg-url": "^5.0.0" 739 | }, 740 | "engines": { 741 | "node": "4.x || >=6.0.0" 742 | }, 743 | "peerDependencies": { 744 | "encoding": "^0.1.0" 745 | }, 746 | "peerDependenciesMeta": { 747 | "encoding": { 748 | "optional": true 749 | } 750 | } 751 | }, 752 | "../downloader/node_modules/once": { 753 | "version": "1.4.0", 754 | "dev": true, 755 | "license": "ISC", 756 | "dependencies": { 757 | "wrappy": "1" 758 | } 759 | }, 760 | "../downloader/node_modules/optionator": { 761 | "version": "0.9.1", 762 | "dev": true, 763 | "license": "MIT", 764 | "dependencies": { 765 | "deep-is": "^0.1.3", 766 | "fast-levenshtein": "^2.0.6", 767 | "levn": "^0.4.1", 768 | "prelude-ls": "^1.2.1", 769 | "type-check": "^0.4.0", 770 | "word-wrap": "^1.2.3" 771 | }, 772 | "engines": { 773 | "node": ">= 0.8.0" 774 | } 775 | }, 776 | "../downloader/node_modules/parent-module": { 777 | "version": "1.0.1", 778 | "dev": true, 779 | "license": "MIT", 780 | "dependencies": { 781 | "callsites": "^3.0.0" 782 | }, 783 | "engines": { 784 | "node": ">=6" 785 | } 786 | }, 787 | "../downloader/node_modules/path-is-absolute": { 788 | "version": "1.0.1", 789 | "dev": true, 790 | "license": "MIT", 791 | "engines": { 792 | "node": ">=0.10.0" 793 | } 794 | }, 795 | "../downloader/node_modules/path-key": { 796 | "version": "3.1.1", 797 | "dev": true, 798 | "license": "MIT", 799 | "engines": { 800 | "node": ">=8" 801 | } 802 | }, 803 | "../downloader/node_modules/prelude-ls": { 804 | "version": "1.2.1", 805 | "dev": true, 806 | "license": "MIT", 807 | "engines": { 808 | "node": ">= 0.8.0" 809 | } 810 | }, 811 | "../downloader/node_modules/punycode": { 812 | "version": "2.1.1", 813 | "dev": true, 814 | "license": "MIT", 815 | "engines": { 816 | "node": ">=6" 817 | } 818 | }, 819 | "../downloader/node_modules/regexpp": { 820 | "version": "3.2.0", 821 | "dev": true, 822 | "license": "MIT", 823 | "engines": { 824 | "node": ">=8" 825 | }, 826 | "funding": { 827 | "url": "https://github.com/sponsors/mysticatea" 828 | } 829 | }, 830 | "../downloader/node_modules/resolve-from": { 831 | "version": "4.0.0", 832 | "dev": true, 833 | "license": "MIT", 834 | "engines": { 835 | "node": ">=4" 836 | } 837 | }, 838 | "../downloader/node_modules/rimraf": { 839 | "version": "3.0.2", 840 | "dev": true, 841 | "license": "ISC", 842 | "dependencies": { 843 | "glob": "^7.1.3" 844 | }, 845 | "bin": { 846 | "rimraf": "bin.js" 847 | }, 848 | "funding": { 849 | "url": "https://github.com/sponsors/isaacs" 850 | } 851 | }, 852 | "../downloader/node_modules/shebang-command": { 853 | "version": "2.0.0", 854 | "dev": true, 855 | "license": "MIT", 856 | "dependencies": { 857 | "shebang-regex": "^3.0.0" 858 | }, 859 | "engines": { 860 | "node": ">=8" 861 | } 862 | }, 863 | "../downloader/node_modules/shebang-regex": { 864 | "version": "3.0.0", 865 | "dev": true, 866 | "license": "MIT", 867 | "engines": { 868 | "node": ">=8" 869 | } 870 | }, 871 | "../downloader/node_modules/strip-ansi": { 872 | "version": "6.0.1", 873 | "dev": true, 874 | "license": "MIT", 875 | "dependencies": { 876 | "ansi-regex": "^5.0.1" 877 | }, 878 | "engines": { 879 | "node": ">=8" 880 | } 881 | }, 882 | "../downloader/node_modules/strip-json-comments": { 883 | "version": "3.1.1", 884 | "dev": true, 885 | "license": "MIT", 886 | "engines": { 887 | "node": ">=8" 888 | }, 889 | "funding": { 890 | "url": "https://github.com/sponsors/sindresorhus" 891 | } 892 | }, 893 | "../downloader/node_modules/supports-color": { 894 | "version": "7.2.0", 895 | "dev": true, 896 | "license": "MIT", 897 | "dependencies": { 898 | "has-flag": "^4.0.0" 899 | }, 900 | "engines": { 901 | "node": ">=8" 902 | } 903 | }, 904 | "../downloader/node_modules/text-table": { 905 | "version": "0.2.0", 906 | "dev": true, 907 | "license": "MIT" 908 | }, 909 | "../downloader/node_modules/tr46": { 910 | "version": "0.0.3", 911 | "dev": true, 912 | "license": "MIT" 913 | }, 914 | "../downloader/node_modules/type-check": { 915 | "version": "0.4.0", 916 | "dev": true, 917 | "license": "MIT", 918 | "dependencies": { 919 | "prelude-ls": "^1.2.1" 920 | }, 921 | "engines": { 922 | "node": ">= 0.8.0" 923 | } 924 | }, 925 | "../downloader/node_modules/type-fest": { 926 | "version": "0.20.2", 927 | "dev": true, 928 | "license": "(MIT OR CC0-1.0)", 929 | "engines": { 930 | "node": ">=10" 931 | }, 932 | "funding": { 933 | "url": "https://github.com/sponsors/sindresorhus" 934 | } 935 | }, 936 | "../downloader/node_modules/typescript": { 937 | "version": "4.7.3", 938 | "dev": true, 939 | "license": "Apache-2.0", 940 | "bin": { 941 | "tsc": "bin/tsc", 942 | "tsserver": "bin/tsserver" 943 | }, 944 | "engines": { 945 | "node": ">=4.2.0" 946 | } 947 | }, 948 | "../downloader/node_modules/uri-js": { 949 | "version": "4.4.1", 950 | "dev": true, 951 | "license": "BSD-2-Clause", 952 | "dependencies": { 953 | "punycode": "^2.1.0" 954 | } 955 | }, 956 | "../downloader/node_modules/v8-compile-cache": { 957 | "version": "2.3.0", 958 | "dev": true, 959 | "license": "MIT" 960 | }, 961 | "../downloader/node_modules/webidl-conversions": { 962 | "version": "3.0.1", 963 | "dev": true, 964 | "license": "BSD-2-Clause" 965 | }, 966 | "../downloader/node_modules/whatwg-url": { 967 | "version": "5.0.0", 968 | "dev": true, 969 | "license": "MIT", 970 | "dependencies": { 971 | "tr46": "~0.0.3", 972 | "webidl-conversions": "^3.0.0" 973 | } 974 | }, 975 | "../downloader/node_modules/which": { 976 | "version": "2.0.2", 977 | "dev": true, 978 | "license": "ISC", 979 | "dependencies": { 980 | "isexe": "^2.0.0" 981 | }, 982 | "bin": { 983 | "node-which": "bin/node-which" 984 | }, 985 | "engines": { 986 | "node": ">= 8" 987 | } 988 | }, 989 | "../downloader/node_modules/word-wrap": { 990 | "version": "1.2.3", 991 | "dev": true, 992 | "license": "MIT", 993 | "engines": { 994 | "node": ">=0.10.0" 995 | } 996 | }, 997 | "../downloader/node_modules/wrappy": { 998 | "version": "1.0.2", 999 | "dev": true, 1000 | "license": "ISC" 1001 | }, 1002 | "node_modules/@embedded-postgres/downloader": { 1003 | "resolved": "../downloader", 1004 | "link": true 1005 | } 1006 | }, 1007 | "dependencies": { 1008 | "@embedded-postgres/downloader": { 1009 | "version": "file:../downloader", 1010 | "requires": { 1011 | "@types/adm-zip": "^0.5.0", 1012 | "@types/node-fetch": "^2.6.1", 1013 | "@types/tar": "^6.1.1", 1014 | "adm-zip": "^0.5.9", 1015 | "eslint": "^8.17.0", 1016 | "node-fetch": "^2.6.7", 1017 | "typescript": "^4.7.3" 1018 | }, 1019 | "dependencies": { 1020 | "@eslint/eslintrc": { 1021 | "version": "1.3.0", 1022 | "dev": true, 1023 | "requires": { 1024 | "ajv": "^6.12.4", 1025 | "debug": "^4.3.2", 1026 | "espree": "^9.3.2", 1027 | "globals": "^13.15.0", 1028 | "ignore": "^5.2.0", 1029 | "import-fresh": "^3.2.1", 1030 | "js-yaml": "^4.1.0", 1031 | "minimatch": "^3.1.2", 1032 | "strip-json-comments": "^3.1.1" 1033 | } 1034 | }, 1035 | "@humanwhocodes/config-array": { 1036 | "version": "0.9.5", 1037 | "dev": true, 1038 | "requires": { 1039 | "@humanwhocodes/object-schema": "^1.2.1", 1040 | "debug": "^4.1.1", 1041 | "minimatch": "^3.0.4" 1042 | } 1043 | }, 1044 | "@humanwhocodes/object-schema": { 1045 | "version": "1.2.1", 1046 | "dev": true 1047 | }, 1048 | "@types/adm-zip": { 1049 | "version": "0.5.0", 1050 | "dev": true, 1051 | "requires": { 1052 | "@types/node": "*" 1053 | } 1054 | }, 1055 | "@types/minipass": { 1056 | "version": "3.1.2", 1057 | "dev": true, 1058 | "requires": { 1059 | "@types/node": "*" 1060 | } 1061 | }, 1062 | "@types/node": { 1063 | "version": "17.0.40", 1064 | "dev": true 1065 | }, 1066 | "@types/node-fetch": { 1067 | "version": "2.6.1", 1068 | "dev": true, 1069 | "requires": { 1070 | "@types/node": "*", 1071 | "form-data": "^3.0.0" 1072 | } 1073 | }, 1074 | "@types/tar": { 1075 | "version": "6.1.1", 1076 | "dev": true, 1077 | "requires": { 1078 | "@types/minipass": "*", 1079 | "@types/node": "*" 1080 | } 1081 | }, 1082 | "acorn": { 1083 | "version": "8.7.1", 1084 | "dev": true 1085 | }, 1086 | "acorn-jsx": { 1087 | "version": "5.3.2", 1088 | "dev": true, 1089 | "requires": {} 1090 | }, 1091 | "adm-zip": { 1092 | "version": "0.5.9", 1093 | "dev": true 1094 | }, 1095 | "ajv": { 1096 | "version": "6.12.6", 1097 | "dev": true, 1098 | "requires": { 1099 | "fast-deep-equal": "^3.1.1", 1100 | "fast-json-stable-stringify": "^2.0.0", 1101 | "json-schema-traverse": "^0.4.1", 1102 | "uri-js": "^4.2.2" 1103 | } 1104 | }, 1105 | "ansi-regex": { 1106 | "version": "5.0.1", 1107 | "dev": true 1108 | }, 1109 | "ansi-styles": { 1110 | "version": "4.3.0", 1111 | "dev": true, 1112 | "requires": { 1113 | "color-convert": "^2.0.1" 1114 | } 1115 | }, 1116 | "argparse": { 1117 | "version": "2.0.1", 1118 | "dev": true 1119 | }, 1120 | "asynckit": { 1121 | "version": "0.4.0", 1122 | "dev": true 1123 | }, 1124 | "balanced-match": { 1125 | "version": "1.0.2", 1126 | "dev": true 1127 | }, 1128 | "brace-expansion": { 1129 | "version": "1.1.11", 1130 | "dev": true, 1131 | "requires": { 1132 | "balanced-match": "^1.0.0", 1133 | "concat-map": "0.0.1" 1134 | } 1135 | }, 1136 | "callsites": { 1137 | "version": "3.1.0", 1138 | "dev": true 1139 | }, 1140 | "chalk": { 1141 | "version": "4.1.2", 1142 | "dev": true, 1143 | "requires": { 1144 | "ansi-styles": "^4.1.0", 1145 | "supports-color": "^7.1.0" 1146 | } 1147 | }, 1148 | "color-convert": { 1149 | "version": "2.0.1", 1150 | "dev": true, 1151 | "requires": { 1152 | "color-name": "~1.1.4" 1153 | } 1154 | }, 1155 | "color-name": { 1156 | "version": "1.1.4", 1157 | "dev": true 1158 | }, 1159 | "combined-stream": { 1160 | "version": "1.0.8", 1161 | "dev": true, 1162 | "requires": { 1163 | "delayed-stream": "~1.0.0" 1164 | } 1165 | }, 1166 | "concat-map": { 1167 | "version": "0.0.1", 1168 | "dev": true 1169 | }, 1170 | "cross-spawn": { 1171 | "version": "7.0.3", 1172 | "dev": true, 1173 | "requires": { 1174 | "path-key": "^3.1.0", 1175 | "shebang-command": "^2.0.0", 1176 | "which": "^2.0.1" 1177 | } 1178 | }, 1179 | "debug": { 1180 | "version": "4.3.4", 1181 | "dev": true, 1182 | "requires": { 1183 | "ms": "2.1.2" 1184 | } 1185 | }, 1186 | "deep-is": { 1187 | "version": "0.1.4", 1188 | "dev": true 1189 | }, 1190 | "delayed-stream": { 1191 | "version": "1.0.0", 1192 | "dev": true 1193 | }, 1194 | "doctrine": { 1195 | "version": "3.0.0", 1196 | "dev": true, 1197 | "requires": { 1198 | "esutils": "^2.0.2" 1199 | } 1200 | }, 1201 | "escape-string-regexp": { 1202 | "version": "4.0.0", 1203 | "dev": true 1204 | }, 1205 | "eslint": { 1206 | "version": "8.17.0", 1207 | "dev": true, 1208 | "requires": { 1209 | "@eslint/eslintrc": "^1.3.0", 1210 | "@humanwhocodes/config-array": "^0.9.2", 1211 | "ajv": "^6.10.0", 1212 | "chalk": "^4.0.0", 1213 | "cross-spawn": "^7.0.2", 1214 | "debug": "^4.3.2", 1215 | "doctrine": "^3.0.0", 1216 | "escape-string-regexp": "^4.0.0", 1217 | "eslint-scope": "^7.1.1", 1218 | "eslint-utils": "^3.0.0", 1219 | "eslint-visitor-keys": "^3.3.0", 1220 | "espree": "^9.3.2", 1221 | "esquery": "^1.4.0", 1222 | "esutils": "^2.0.2", 1223 | "fast-deep-equal": "^3.1.3", 1224 | "file-entry-cache": "^6.0.1", 1225 | "functional-red-black-tree": "^1.0.1", 1226 | "glob-parent": "^6.0.1", 1227 | "globals": "^13.15.0", 1228 | "ignore": "^5.2.0", 1229 | "import-fresh": "^3.0.0", 1230 | "imurmurhash": "^0.1.4", 1231 | "is-glob": "^4.0.0", 1232 | "js-yaml": "^4.1.0", 1233 | "json-stable-stringify-without-jsonify": "^1.0.1", 1234 | "levn": "^0.4.1", 1235 | "lodash.merge": "^4.6.2", 1236 | "minimatch": "^3.1.2", 1237 | "natural-compare": "^1.4.0", 1238 | "optionator": "^0.9.1", 1239 | "regexpp": "^3.2.0", 1240 | "strip-ansi": "^6.0.1", 1241 | "strip-json-comments": "^3.1.0", 1242 | "text-table": "^0.2.0", 1243 | "v8-compile-cache": "^2.0.3" 1244 | } 1245 | }, 1246 | "eslint-scope": { 1247 | "version": "7.1.1", 1248 | "dev": true, 1249 | "requires": { 1250 | "esrecurse": "^4.3.0", 1251 | "estraverse": "^5.2.0" 1252 | } 1253 | }, 1254 | "eslint-utils": { 1255 | "version": "3.0.0", 1256 | "dev": true, 1257 | "requires": { 1258 | "eslint-visitor-keys": "^2.0.0" 1259 | }, 1260 | "dependencies": { 1261 | "eslint-visitor-keys": { 1262 | "version": "2.1.0", 1263 | "dev": true 1264 | } 1265 | } 1266 | }, 1267 | "eslint-visitor-keys": { 1268 | "version": "3.3.0", 1269 | "dev": true 1270 | }, 1271 | "espree": { 1272 | "version": "9.3.2", 1273 | "dev": true, 1274 | "requires": { 1275 | "acorn": "^8.7.1", 1276 | "acorn-jsx": "^5.3.2", 1277 | "eslint-visitor-keys": "^3.3.0" 1278 | } 1279 | }, 1280 | "esquery": { 1281 | "version": "1.4.0", 1282 | "dev": true, 1283 | "requires": { 1284 | "estraverse": "^5.1.0" 1285 | } 1286 | }, 1287 | "esrecurse": { 1288 | "version": "4.3.0", 1289 | "dev": true, 1290 | "requires": { 1291 | "estraverse": "^5.2.0" 1292 | } 1293 | }, 1294 | "estraverse": { 1295 | "version": "5.3.0", 1296 | "dev": true 1297 | }, 1298 | "esutils": { 1299 | "version": "2.0.3", 1300 | "dev": true 1301 | }, 1302 | "fast-deep-equal": { 1303 | "version": "3.1.3", 1304 | "dev": true 1305 | }, 1306 | "fast-json-stable-stringify": { 1307 | "version": "2.1.0", 1308 | "dev": true 1309 | }, 1310 | "fast-levenshtein": { 1311 | "version": "2.0.6", 1312 | "dev": true 1313 | }, 1314 | "file-entry-cache": { 1315 | "version": "6.0.1", 1316 | "dev": true, 1317 | "requires": { 1318 | "flat-cache": "^3.0.4" 1319 | } 1320 | }, 1321 | "flat-cache": { 1322 | "version": "3.0.4", 1323 | "dev": true, 1324 | "requires": { 1325 | "flatted": "^3.1.0", 1326 | "rimraf": "^3.0.2" 1327 | } 1328 | }, 1329 | "flatted": { 1330 | "version": "3.2.5", 1331 | "dev": true 1332 | }, 1333 | "form-data": { 1334 | "version": "3.0.1", 1335 | "dev": true, 1336 | "requires": { 1337 | "asynckit": "^0.4.0", 1338 | "combined-stream": "^1.0.8", 1339 | "mime-types": "^2.1.12" 1340 | } 1341 | }, 1342 | "fs.realpath": { 1343 | "version": "1.0.0", 1344 | "dev": true 1345 | }, 1346 | "functional-red-black-tree": { 1347 | "version": "1.0.1", 1348 | "dev": true 1349 | }, 1350 | "glob": { 1351 | "version": "7.2.3", 1352 | "dev": true, 1353 | "requires": { 1354 | "fs.realpath": "^1.0.0", 1355 | "inflight": "^1.0.4", 1356 | "inherits": "2", 1357 | "minimatch": "^3.1.1", 1358 | "once": "^1.3.0", 1359 | "path-is-absolute": "^1.0.0" 1360 | } 1361 | }, 1362 | "glob-parent": { 1363 | "version": "6.0.2", 1364 | "dev": true, 1365 | "requires": { 1366 | "is-glob": "^4.0.3" 1367 | } 1368 | }, 1369 | "globals": { 1370 | "version": "13.15.0", 1371 | "dev": true, 1372 | "requires": { 1373 | "type-fest": "^0.20.2" 1374 | } 1375 | }, 1376 | "has-flag": { 1377 | "version": "4.0.0", 1378 | "dev": true 1379 | }, 1380 | "ignore": { 1381 | "version": "5.2.0", 1382 | "dev": true 1383 | }, 1384 | "import-fresh": { 1385 | "version": "3.3.0", 1386 | "dev": true, 1387 | "requires": { 1388 | "parent-module": "^1.0.0", 1389 | "resolve-from": "^4.0.0" 1390 | } 1391 | }, 1392 | "imurmurhash": { 1393 | "version": "0.1.4", 1394 | "dev": true 1395 | }, 1396 | "inflight": { 1397 | "version": "1.0.6", 1398 | "dev": true, 1399 | "requires": { 1400 | "once": "^1.3.0", 1401 | "wrappy": "1" 1402 | } 1403 | }, 1404 | "inherits": { 1405 | "version": "2.0.4", 1406 | "dev": true 1407 | }, 1408 | "is-extglob": { 1409 | "version": "2.1.1", 1410 | "dev": true 1411 | }, 1412 | "is-glob": { 1413 | "version": "4.0.3", 1414 | "dev": true, 1415 | "requires": { 1416 | "is-extglob": "^2.1.1" 1417 | } 1418 | }, 1419 | "isexe": { 1420 | "version": "2.0.0", 1421 | "dev": true 1422 | }, 1423 | "js-yaml": { 1424 | "version": "4.1.0", 1425 | "dev": true, 1426 | "requires": { 1427 | "argparse": "^2.0.1" 1428 | } 1429 | }, 1430 | "json-schema-traverse": { 1431 | "version": "0.4.1", 1432 | "dev": true 1433 | }, 1434 | "json-stable-stringify-without-jsonify": { 1435 | "version": "1.0.1", 1436 | "dev": true 1437 | }, 1438 | "levn": { 1439 | "version": "0.4.1", 1440 | "dev": true, 1441 | "requires": { 1442 | "prelude-ls": "^1.2.1", 1443 | "type-check": "~0.4.0" 1444 | } 1445 | }, 1446 | "lodash.merge": { 1447 | "version": "4.6.2", 1448 | "dev": true 1449 | }, 1450 | "mime-db": { 1451 | "version": "1.52.0", 1452 | "dev": true 1453 | }, 1454 | "mime-types": { 1455 | "version": "2.1.35", 1456 | "dev": true, 1457 | "requires": { 1458 | "mime-db": "1.52.0" 1459 | } 1460 | }, 1461 | "minimatch": { 1462 | "version": "3.1.2", 1463 | "dev": true, 1464 | "requires": { 1465 | "brace-expansion": "^1.1.7" 1466 | } 1467 | }, 1468 | "ms": { 1469 | "version": "2.1.2", 1470 | "dev": true 1471 | }, 1472 | "natural-compare": { 1473 | "version": "1.4.0", 1474 | "dev": true 1475 | }, 1476 | "node-fetch": { 1477 | "version": "2.6.7", 1478 | "dev": true, 1479 | "requires": { 1480 | "whatwg-url": "^5.0.0" 1481 | } 1482 | }, 1483 | "once": { 1484 | "version": "1.4.0", 1485 | "dev": true, 1486 | "requires": { 1487 | "wrappy": "1" 1488 | } 1489 | }, 1490 | "optionator": { 1491 | "version": "0.9.1", 1492 | "dev": true, 1493 | "requires": { 1494 | "deep-is": "^0.1.3", 1495 | "fast-levenshtein": "^2.0.6", 1496 | "levn": "^0.4.1", 1497 | "prelude-ls": "^1.2.1", 1498 | "type-check": "^0.4.0", 1499 | "word-wrap": "^1.2.3" 1500 | } 1501 | }, 1502 | "parent-module": { 1503 | "version": "1.0.1", 1504 | "dev": true, 1505 | "requires": { 1506 | "callsites": "^3.0.0" 1507 | } 1508 | }, 1509 | "path-is-absolute": { 1510 | "version": "1.0.1", 1511 | "dev": true 1512 | }, 1513 | "path-key": { 1514 | "version": "3.1.1", 1515 | "dev": true 1516 | }, 1517 | "prelude-ls": { 1518 | "version": "1.2.1", 1519 | "dev": true 1520 | }, 1521 | "punycode": { 1522 | "version": "2.1.1", 1523 | "dev": true 1524 | }, 1525 | "regexpp": { 1526 | "version": "3.2.0", 1527 | "dev": true 1528 | }, 1529 | "resolve-from": { 1530 | "version": "4.0.0", 1531 | "dev": true 1532 | }, 1533 | "rimraf": { 1534 | "version": "3.0.2", 1535 | "dev": true, 1536 | "requires": { 1537 | "glob": "^7.1.3" 1538 | } 1539 | }, 1540 | "shebang-command": { 1541 | "version": "2.0.0", 1542 | "dev": true, 1543 | "requires": { 1544 | "shebang-regex": "^3.0.0" 1545 | } 1546 | }, 1547 | "shebang-regex": { 1548 | "version": "3.0.0", 1549 | "dev": true 1550 | }, 1551 | "strip-ansi": { 1552 | "version": "6.0.1", 1553 | "dev": true, 1554 | "requires": { 1555 | "ansi-regex": "^5.0.1" 1556 | } 1557 | }, 1558 | "strip-json-comments": { 1559 | "version": "3.1.1", 1560 | "dev": true 1561 | }, 1562 | "supports-color": { 1563 | "version": "7.2.0", 1564 | "dev": true, 1565 | "requires": { 1566 | "has-flag": "^4.0.0" 1567 | } 1568 | }, 1569 | "text-table": { 1570 | "version": "0.2.0", 1571 | "dev": true 1572 | }, 1573 | "tr46": { 1574 | "version": "0.0.3", 1575 | "dev": true 1576 | }, 1577 | "type-check": { 1578 | "version": "0.4.0", 1579 | "dev": true, 1580 | "requires": { 1581 | "prelude-ls": "^1.2.1" 1582 | } 1583 | }, 1584 | "type-fest": { 1585 | "version": "0.20.2", 1586 | "dev": true 1587 | }, 1588 | "typescript": { 1589 | "version": "4.7.3", 1590 | "dev": true 1591 | }, 1592 | "uri-js": { 1593 | "version": "4.4.1", 1594 | "dev": true, 1595 | "requires": { 1596 | "punycode": "^2.1.0" 1597 | } 1598 | }, 1599 | "v8-compile-cache": { 1600 | "version": "2.3.0", 1601 | "dev": true 1602 | }, 1603 | "webidl-conversions": { 1604 | "version": "3.0.1", 1605 | "dev": true 1606 | }, 1607 | "whatwg-url": { 1608 | "version": "5.0.0", 1609 | "dev": true, 1610 | "requires": { 1611 | "tr46": "~0.0.3", 1612 | "webidl-conversions": "^3.0.0" 1613 | } 1614 | }, 1615 | "which": { 1616 | "version": "2.0.2", 1617 | "dev": true, 1618 | "requires": { 1619 | "isexe": "^2.0.0" 1620 | } 1621 | }, 1622 | "word-wrap": { 1623 | "version": "1.2.3", 1624 | "dev": true 1625 | }, 1626 | "wrappy": { 1627 | "version": "1.0.2", 1628 | "dev": true 1629 | } 1630 | } 1631 | } 1632 | } 1633 | } 1634 | --------------------------------------------------------------------------------