@crvouga/mockingbird-service-postgres 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -1
- package/README.md +8 -5
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-postgres
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.3.0 (2026-09-30)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- state each mock's parity and share one CSS reset ([264b06e](https://github.com/crvouga/mockingbird/commit/264b06ef15efc1d5131bbf78c89f45e2ce86b557))
|
|
8
|
+
|
|
9
|
+
## 1.2.0 (2026-09-29)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- share one field-guide identity across the docs site and READMEs ([024f445](https://github.com/crvouga/mockingbird/commit/024f445c143e0d2d07a4dd0a3c063bca94c59623))
|
|
14
|
+
|
|
15
|
+
### Fixes and improvements
|
|
16
|
+
|
|
17
|
+
- typecheck the postgres and sqlite README signature blocks ([cd2080b](https://github.com/crvouga/mockingbird/commit/cd2080b1af98f2746de063f289382527e28acfb2))
|
|
18
|
+
|
|
19
|
+
## 1.1.0 (2026-09-25)
|
|
4
20
|
|
|
5
21
|
### Features
|
|
6
22
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @crvouga/mockingbird-service-postgres
|
|
2
2
|
|
|
3
|
+
> Familiar calls. Faithful echoes. Part of [Mockingbird](https://github.com/crvouga/mockingbird).
|
|
4
|
+
|
|
3
5
|
Pure TypeScript, completely in-memory PostgreSQL engine aiming for **PostgreSQL 18 SQL dialect
|
|
4
6
|
parity** (same statements, same results). Use it in tests (or the browser) wherever you want real
|
|
5
7
|
PostgreSQL SQL semantics without a server: schema + migrations, constraints and SQLSTATE errors,
|
|
@@ -350,7 +352,7 @@ Stable runtime exports of the main entry:
|
|
|
350
352
|
Signatures (types are exported too: `DatabaseOptions`, `RegisterFunctionOptions`, `ResultSet`,
|
|
351
353
|
`RunResult`, `ErrorCategory`, `BindValue`, `JsValue`, `QueryRow`):
|
|
352
354
|
|
|
353
|
-
```
|
|
355
|
+
```ts
|
|
354
356
|
interface DatabaseOptions {
|
|
355
357
|
seed?: number | bigint // default 1; ignored when random is "os"
|
|
356
358
|
random?: "deterministic" | "os" // default "deterministic"; "os" is CSPRNG like PostgreSQL
|
|
@@ -358,7 +360,7 @@ interface DatabaseOptions {
|
|
|
358
360
|
int8?: "bigint" | "number" | "string" // default "bigint"; "number" is unsafe beyond MAX_SAFE_INTEGER
|
|
359
361
|
}
|
|
360
362
|
|
|
361
|
-
class Database {
|
|
363
|
+
declare class Database {
|
|
362
364
|
constructor(options?: DatabaseOptions)
|
|
363
365
|
exec(sql: string): void
|
|
364
366
|
registerFunction(spec: { name: string; args: string[]; returns: string; strict?: boolean;
|
|
@@ -377,13 +379,13 @@ class Database {
|
|
|
377
379
|
readonly int8Mode: "bigint" | "number" | "string"
|
|
378
380
|
}
|
|
379
381
|
|
|
380
|
-
class Snapshot {
|
|
382
|
+
declare class Snapshot {
|
|
381
383
|
open(options?: DatabaseOptions): Database
|
|
382
384
|
encode(): Uint8Array
|
|
383
385
|
static decode(bytes: Uint8Array): Snapshot
|
|
384
386
|
}
|
|
385
387
|
|
|
386
|
-
class Statement {
|
|
388
|
+
declare class Statement {
|
|
387
389
|
readonly sql: string
|
|
388
390
|
run(...params: BindValue[]): RunResult
|
|
389
391
|
all<T = QueryRow>(...params: BindValue[]): T[]
|
|
@@ -397,12 +399,13 @@ interface ResultSet { columns: string[]; columnTypes: string[]; rows: QueryR
|
|
|
397
399
|
interface TextResultSet { columns: string[]; columnTypes: string[]; rows: (string | null)[][]; rowCount: number; command: string }
|
|
398
400
|
// columnTypes are PostgreSQL internal type names, e.g. "int4", "numeric"
|
|
399
401
|
|
|
400
|
-
class PostgresError extends Error {
|
|
402
|
+
declare class PostgresError extends Error {
|
|
401
403
|
readonly category: ErrorCategory // "syntax", "undefined_table", "constraint_unique", "misuse", ...
|
|
402
404
|
readonly sqlState: string // five-character SQLSTATE
|
|
403
405
|
readonly code: string // === sqlState (node-postgres err.code convention)
|
|
404
406
|
}
|
|
405
407
|
|
|
408
|
+
type ErrorCategory = string // "syntax" | "undefined_table" | "constraint_unique" | "misuse" | ...
|
|
406
409
|
type BindValue = null | undefined | boolean | number | bigint | string | Uint8Array | Date
|
|
407
410
|
type JsValue = null | boolean | number | bigint | string | Uint8Array
|
|
408
411
|
type QueryRow = Record<string, JsValue>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crvouga/mockingbird-service-postgres",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Pure TypeScript in-memory PostgreSQL implementation with zero WASM/native dependencies",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -98,6 +98,7 @@
|
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
100
100
|
"@biomejs/biome": "^2.5.8",
|
|
101
|
+
"@crvouga/mockingbird-ui": "0.0.0-development",
|
|
101
102
|
"@electric-sql/pglite": "^0.5.5",
|
|
102
103
|
"@types/bun": "latest",
|
|
103
104
|
"@types/pg": "^8.23.1",
|
|
@@ -130,7 +131,7 @@
|
|
|
130
131
|
"website": "https://www.postgresql.org",
|
|
131
132
|
"docs": "https://www.postgresql.org/docs/current/"
|
|
132
133
|
},
|
|
133
|
-
"
|
|
134
|
+
"parity": "In-memory SQL engine",
|
|
134
135
|
"entries": {
|
|
135
136
|
"wire/index": "node",
|
|
136
137
|
"wire/cli": "node"
|