{"_id":"@alancnet/psqlite","name":"@alancnet/psqlite","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@alancnet/psqlite","version":"1.0.0","description":"Interactive sqlite3-style shell for PGlite (PostgreSQL in WASM)","type":"module","bin":{"psqlite":"bin/psqlite.js"},"engines":{"node":">=18"},"keywords":["pglite","postgresql","postgres","cli","repl","sqlite","wasm","electric-sql"],"license":"MIT","peerDependencies":{"@electric-sql/pglite":">=0.2.0"},"peerDependenciesMeta":{"@electric-sql/pglite":{"optional":true}},"gitHead":"9c7167d44b3d99fe481ba158f881bffb093cb908","_id":"@alancnet/psqlite@1.0.0","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-Q1GJhf9gLzVTYp6zhbKbOFrpHjCxuHWSIyUddVrnNoB0oEi8t0bEMRy24ecZsxlT4OLjil3YX+kRSl4bhpHSGA==","shasum":"23c8694578e786f7ebaa7cf498148ccb44514574","tarball":"https://registry.npmjs.org/@alancnet/psqlite/-/psqlite-1.0.0.tgz","fileCount":3,"unpackedSize":24521,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHOO8prZQXszT2Uo9tITS1f2T9ESahgkhwMfwpj/AWlvAiEAhMjteDYyhYqSvdlHP/Km5H0aBMkOnXZUtJ9mie6lQMc="}]},"_npmUser":{"name":"alancnet","email":"npm@alanc.net"},"directories":{},"maintainers":[{"name":"alancnet","email":"npm@alanc.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/psqlite_1.0.0_1777860784114_0.11072737252641884"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-04T02:13:04.051Z","1.0.0":"2026-05-04T02:13:04.284Z","modified":"2026-05-04T02:13:04.455Z"},"maintainers":[{"name":"alancnet","email":"npm@alanc.net"}],"description":"Interactive sqlite3-style shell for PGlite (PostgreSQL in WASM)","keywords":["pglite","postgresql","postgres","cli","repl","sqlite","wasm","electric-sql"],"license":"MIT","readme":"# psqlite\n\nInteractive command-line shell for [PGlite](https://pglite.dev/)—PostgreSQL compiled to WebAssembly—with a **sqlite3-shaped** interface: flags, one-shot SQL, piping, and dot commands.\n\n## Install\n\n```bash\nnpm install -g @alancnet/psqlite\n```\n\nThe **`psqlite`** command name is unchanged after install.\n\nRequires **Node.js 18+**. **PGlite is not installed by this package.** Install `@electric-sql/pglite` in your project or globally (`npm install -g @electric-sql/pglite`). At runtime, psqlite loads PGlite from the **nearest `package.json` directory** when walking up from your **current working directory**, then from the **global** npm modules folder if needed.\n\n## Usage\n\nSame overall shape as **sqlite3**: optional flags, then **`FILENAME`** (the PGlite data directory), then optional **SQL** to run once. If you omit **`FILENAME`**, **`PSQLITE_DATA_DIR`**, and **`-d`**, psqlite uses the current directory when it looks like an initialized PGlite/PostgreSQL data directory (e.g. it contains **`PG_VERSION`**—typical when your shell is **`cd`**’d into the cluster).\n\nStart the REPL:\n\n```bash\npsqlite ./mydb\n# or\nPSQLITE_DATA_DIR=./data psqlite\n# or\npsqlite -d ./data\n```\n\nRun SQL and exit:\n\n```bash\npsqlite ./mydb -e \"SELECT version()\"\npsqlite ./mydb \"SELECT 1\"\n```\n\nOther common options:\n\n```bash\npsqlite --help\npsqlite -version\npsqlite -csv -noheader ./data \"SELECT * FROM mytable LIMIT 5\"\npsqlite -init schema.sql ./data\npsqlite --file queries.sql -d ./data\necho \"SELECT 1\" | psqlite -batch ./mydb\n```\n\n### Environment\n\n| Variable | Meaning |\n|----------|---------|\n| `PSQLITE_DATA_DIR` | Database directory when you omit **`FILENAME`** on the command line (`-d` / `--data-dir` overrides this and **`FILENAME`**) |\n\n### Dot commands (interactive)\n\nAt the `pglite>` prompt: `.tables`, `.schema`, `.indexes`, `.mode`, `.headers`, `.pretty`, `.databases`, `.quit` / `.exit` / `\\q`.\n\n## Developing this repo\n\nThis package does not ship `@electric-sql/pglite`. Install it in this directory (or run the CLI from another project that already depends on PGlite):\n\n```bash\nnpm install\nnpm install @electric-sql/pglite\nnode bin/psqlite.js --help\n```\n\nLink globally while hacking:\n\n```bash\nnpm link\npsqlite -version\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-25eec9ad675dd152369ed6b813894fd0"}