Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion site/src/pages/_HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ await todo.update({ completed: true }).execute(db);`,
{
title: "3. Expose your API over RPC, Safely",
description:
"Give clients a composable query builder with your unescapable data boundaries. Compose queries in the client with rich Postgres features and function as primitives.",
"Give clients a composable query builder with your inescapable data boundaries. Compose queries in the client with rich Postgres features and functions as primitives.",
leftCode: `class User extends db.Table("users") {
// ...
}
Expand Down
8 changes: 8 additions & 0 deletions src/types/emission/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ export const OPERATOR_ALIASES: { [op: string]: string } = {
"<=": "lte",
">": "gt",
">=": "gte",
// Pattern matching. `like` is also a real function on both hosts
// (sqlite's like(X,Y), pg's catalog like), so the emitter's collision
// rule keeps the host function under that name and its signature stays
// authoritative; the `['~~']` bracket form covers the operator.
"~~": "like",
"~~*": "ilike",
"!~~": "notLike",
"!~~*": "notIlike",
"+": "plus",
"-": "minus",
"*": "times",
Expand Down
4 changes: 2 additions & 2 deletions src/types/postgres/generated/anyarray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ export class Anyarray<T extends types.Any<any>, in out N extends number> extends
max(): types.Anyarray<T, 0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; }
@expose.unchecked()
min(): types.Anyarray<T, 0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; }
generateSubscripts<M0 extends types.Int4<any> | number, M1 extends types.Bool<any> | boolean>(arg0: M0, arg1: M1): runtime.Srf<{ generate_subscripts: types.Int4<runtime.StrictNull<N | runtime.NullOf<M0> | runtime.NullOf<M1>>> }, "generate_subscripts">;
generateSubscripts<M0 extends types.Int4<any> | number>(arg0: M0): runtime.Srf<{ generate_subscripts: types.Int4<runtime.StrictNull<N | runtime.NullOf<M0>>> }, "generate_subscripts">;
generateSubscripts<M0 extends types.Int4<any> | number, M1 extends types.Bool<any> | boolean>(arg0: M0, arg1: M1): runtime.Srf<{ generate_subscripts: types.Int4<runtime.StrictNull<N | runtime.NullOf<M0> | runtime.NullOf<M1>>> }, "generate_subscripts">;
@expose.unchecked()
generateSubscripts(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Int4], [[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return new runtime.Srf("generate_subscripts", [this, ...__rest], [["generate_subscripts", __rt]]) as any; }
generateSubscripts(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Int4, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Int4]]); return new runtime.Srf("generate_subscripts", [this, ...__rest], [["generate_subscripts", __rt]]) as any; }
@expose.unchecked()
unnest(): runtime.Srf<{ unnest: T }, "unnest"> { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgElement(this)]]); return new runtime.Srf("unnest", [this, ...__rest], [["unnest", __rt]]) as any; }
@expose.unchecked()
Expand Down
8 changes: 4 additions & 4 deletions src/types/postgres/generated/anycompatiblearray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ export class Anycompatiblearray<T extends types.Any<any>, in out N extends numbe
arrayAppend<M0 extends T | runtime.TsTypeOf<T>>(arg0: M0): types.Anycompatiblearray<T, 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anycompatible, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.funcCall("array_append", [this, ...__rest], __rt) as any; }
@expose.unchecked()
arrayCat<M0 extends types.Anycompatiblearray<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Anycompatiblearray<T, 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anycompatiblearray, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.funcCall("array_cat", [this, ...__rest], __rt) as any; }
arrayPosition<M0 extends T | runtime.TsTypeOf<T>, M1 extends types.Int4<any> | number>(arg0: M0, arg1: M1): types.Int4<1>;
arrayPosition<M0 extends T | runtime.TsTypeOf<T>>(arg0: M0): types.Int4<1>;
arrayPosition<M0 extends T | runtime.TsTypeOf<T>, M1 extends types.Int4<any> | number>(arg0: M0, arg1: M1): types.Int4<1>;
@expose.unchecked()
arrayPosition(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Anycompatible, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Anycompatible, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("array_position", [this, ...__rest], __rt) as any; }
arrayPosition(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Anycompatible, allowPrimitive: true }], types.Int4], [[{ type: types.Anycompatible, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("array_position", [this, ...__rest], __rt) as any; }
@expose.unchecked()
arrayRemove<M0 extends T | runtime.TsTypeOf<T>>(arg0: M0): types.Anycompatiblearray<T, 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anycompatible, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.funcCall("array_remove", [this, ...__rest], __rt) as any; }
@expose.unchecked()
arrayReplace<M0 extends T | runtime.TsTypeOf<T>, M1 extends T | runtime.TsTypeOf<T>>(arg0: M0, arg1: M1): types.Anycompatiblearray<T, 1> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Anycompatible, allowPrimitive: true }, { type: types.Anycompatible, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.funcCall("array_replace", [this, ...__rest], __rt) as any; }
['||']<M0 extends types.Anycompatiblearray<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Anycompatiblearray<T, runtime.StrictNull<N | runtime.NullOf<M0>>>;
['||']<M0 extends T>(arg0: M0): types.Anycompatiblearray<T, runtime.StrictNull<N | runtime.NullOf<M0>>>;
['||']<M0 extends types.Anycompatiblearray<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Anycompatiblearray<T, runtime.StrictNull<N | runtime.NullOf<M0>>>;
@expose.unchecked()
['||'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anycompatiblearray, allowPrimitive: true }], runtime.pgType(this)], [[{ type: types.Anycompatible }], runtime.pgType(this)]]); return runtime.opCall(runtime.sql`||`, [this, ...__rest] as [unknown, unknown], __rt) as any; }
['||'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anycompatible }], runtime.pgType(this)], [[{ type: types.Anycompatiblearray, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.opCall(runtime.sql`||`, [this, ...__rest] as [unknown, unknown], __rt) as any; }
}
18 changes: 9 additions & 9 deletions src/types/postgres/generated/anymultirange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ export class Anymultirange<T extends types.Any<any>, in out N extends number> ex
['&&']<M0 extends types.Anymultirange<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
@expose.unchecked()
['&&'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange }], types.Bool], [[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`&&`, [this, ...__rest] as [unknown, unknown], __rt) as any; }
['&<']<M0 extends types.Anymultirange<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
['&<']<M0 extends types.Anyrange<T, any>>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
['&<']<M0 extends types.Anymultirange<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
@expose.unchecked()
['&<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool], [[{ type: types.Anyrange }], types.Bool]]); return runtime.opCall(runtime.sql`&<`, [this, ...__rest] as [unknown, unknown], __rt) as any; }
['&<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange }], types.Bool], [[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`&<`, [this, ...__rest] as [unknown, unknown], __rt) as any; }
['&>']<M0 extends types.Anyrange<T, any>>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
['&>']<M0 extends types.Anymultirange<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
@expose.unchecked()
Expand All @@ -96,10 +96,10 @@ export class Anymultirange<T extends types.Any<any>, in out N extends number> ex
['<']<M0 extends types.Anymultirange<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; }
@expose.unchecked()
lt<M0 extends types.Anymultirange<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; }
['<<']<M0 extends types.Anymultirange<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
['<<']<M0 extends types.Anyrange<T, any>>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
['<<']<M0 extends types.Anymultirange<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
@expose.unchecked()
['<<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool], [[{ type: types.Anyrange }], types.Bool]]); return runtime.opCall(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; }
['<<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange }], types.Bool], [[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; }
@expose.unchecked()
['<=']<M0 extends types.Anymultirange<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; }
@expose.unchecked()
Expand All @@ -124,13 +124,13 @@ export class Anymultirange<T extends types.Any<any>, in out N extends number> ex
['>=']<M0 extends types.Anymultirange<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; }
@expose.unchecked()
gte<M0 extends types.Anymultirange<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; }
['>>']<M0 extends types.Anymultirange<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
['>>']<M0 extends types.Anyrange<T, any>>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
['>>']<M0 extends types.Anymultirange<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
@expose.unchecked()
['>>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool], [[{ type: types.Anyrange }], types.Bool]]); return runtime.opCall(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; }
['@>']<M0 extends types.Anymultirange<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
['@>']<M0 extends types.Anyrange<T, any>>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
['>>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange }], types.Bool], [[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; }
['@>']<M0 extends T>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
['@>']<M0 extends types.Anyrange<T, any>>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
['@>']<M0 extends types.Anymultirange<T, any> | runtime.TsTypeOf<T>[]>(arg0: M0): types.Bool<runtime.StrictNull<N | runtime.NullOf<M0>>>;
@expose.unchecked()
['@>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool], [[{ type: types.Anyrange }], types.Bool], [[{ type: types.Anyelement }], types.Bool]]); return runtime.opCall(runtime.sql`@>`, [this, ...__rest] as [unknown, unknown], __rt) as any; }
['@>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyelement }], types.Bool], [[{ type: types.Anyrange }], types.Bool], [[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`@>`, [this, ...__rest] as [unknown, unknown], __rt) as any; }
}
Loading
Loading