-
Clone the repository:
git clone https://github.com/F1nnM/just-bash-postgres.git cd just-bash-postgres -
Install dependencies:
bun install
-
Start PostgreSQL:
docker compose up -d
This starts PostgreSQL 17 with pgvector on port 5433 using trust authentication.
bun testTests connect to postgres://postgres@localhost:5433/just_bash_postgres_test by default. Override with TEST_DATABASE_URL.
bun test tests/search.test.tsbun run typechecksrc/
index.ts # Public exports
pg-filesystem.ts # Core IFileSystem implementation
schema.ts # Schema migrations (idempotent)
search.ts # Full-text, semantic, and hybrid search
path-encoding.ts # POSIX path <-> ltree conversion
sql/
001-setup.sql # Main schema DDL
tests/
helpers.ts # Shared test utilities
*.test.ts # Test files
- All filesystem state lives in a single
fs_nodestable - Paths are stored as
ltreelabels prefixed withs{sessionId} - Special characters in path segments are encoded (e.g.,
_->__5F__,.->__dot__) - Every public method calls
normalizePath()and runs inside awithSession()transaction that setsapp.session_idfor RLS
- Tests run against a real PostgreSQL instance -- no mocks
- All schema changes must be idempotent (
IF NOT EXISTS,DO $$ ... EXCEPTION ...) - New public methods should respect session isolation via
withSession()