@supabase/lite 0.9.1-next.1 → 0.9.1-next.2

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.
Files changed (50) hide show
  1. package/FEATURES.md +6 -6
  2. package/LIMITATIONS.md +8 -6
  3. package/PATTERNS.md +66 -6
  4. package/README.md +15 -8
  5. package/STATUS.md +26 -19
  6. package/dist/{Connection-ZWTDByQ5.d.ts → Connection-f_d5HhQ0.d.ts} +301 -293
  7. package/dist/cli/index.js +127 -124
  8. package/dist/cli/lib.d.ts +1 -12
  9. package/dist/cli/lib.js +44 -39
  10. package/dist/db/fallback.d.ts +1 -1
  11. package/dist/db/postgres/PostgresConnection.js +18 -18
  12. package/dist/db/postgres/pglite/PgliteConnection.js +4 -4
  13. package/dist/index.d.ts +90 -38
  14. package/dist/index.js +181 -73
  15. package/dist/static/.vite/manifest.json +34 -2
  16. package/dist/static/assets/InterVariable-Dx4kXJAl.woff2 +0 -0
  17. package/dist/static/assets/InterVariable-Italic-DpCbqKDY.woff2 +0 -0
  18. package/dist/static/assets/SourceCodePro-Variable-BP8Zz55n.woff2 +0 -0
  19. package/dist/static/assets/SourceCodePro-Variable-Italic-eALmlzX7.woff2 +0 -0
  20. package/dist/static/assets/main-BY4iigay.css +1 -0
  21. package/dist/static/assets/main-BnQ-v4V9.js +199 -0
  22. package/dist/static/assets/manrope-latin-ext-wght-normal-Ch3YOpNY.woff2 +0 -0
  23. package/dist/static/assets/manrope-latin-wght-normal-DHIcAJRg.woff2 +0 -0
  24. package/dist/vite/index.d.ts +601 -29
  25. package/dist/vite/index.js +2 -2
  26. package/docs/auth/overview.mdx +1 -1
  27. package/docs/auth/supported-flows.mdx +4 -4
  28. package/docs/compatibility.mdx +4 -4
  29. package/docs/database/migrations.mdx +2 -0
  30. package/docs/database/rls.mdx +7 -5
  31. package/docs/database/schemas.mdx +1 -1
  32. package/docs/integrations/embedded.mdx +20 -3
  33. package/docs/integrations/frameworks.mdx +1 -1
  34. package/docs/integrations/vite.mdx +4 -2
  35. package/docs/llms.txt +2 -2
  36. package/docs/quickstart.mdx +2 -2
  37. package/docs/running.mdx +20 -10
  38. package/docs/storage/limitations.mdx +2 -11
  39. package/docs/storage/overview.mdx +8 -2
  40. package/package.json +2 -1
  41. package/skills/supalite/SKILL.md +1 -1
  42. package/dist/static/assets/main-1bwWb_1q.js +0 -40996
  43. package/dist/static/assets/main-BDsRycsc.css +0 -4045
  44. package/dist/static/fonts/CustomFont-Black.woff2 +0 -0
  45. package/dist/static/fonts/CustomFont-BlackItalic.woff2 +0 -0
  46. package/dist/static/fonts/CustomFont-Bold.woff2 +0 -0
  47. package/dist/static/fonts/CustomFont-BoldItalic.woff2 +0 -0
  48. package/dist/static/fonts/CustomFont-Book.woff2 +0 -0
  49. package/dist/static/fonts/CustomFont-BookItalic.woff2 +0 -0
  50. package/dist/static/fonts/CustomFont-Medium.woff2 +0 -0
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _supabase_supabase_js from '@supabase/supabase-js';
2
2
  import { SupabaseClientOptions } from '@supabase/supabase-js';
3
3
  import { D as DefaultSchema, S as Schema } from './index-DKO3OQpz.js';
4
- import { Connection, ConnectionMigrator, MaybePromise as MaybePromise$1, SchemaDiffResult, PlanStep, PlanResult, IConnectionConfig, Dialect as Dialect$2, IntrospectResult as IntrospectResult$1, TransactionOptions } from '@supabase/lite';
4
+ import { Connection as Connection$1, ConnectionMigrator, MaybePromise as MaybePromise$1, SchemaDiffResult, PlanStep, PlanResult, IConnectionConfig, Dialect as Dialect$1, IntrospectResult as IntrospectResult$1, TransactionOptions } from '@supabase/lite';
5
5
  import * as hono_hono_base from 'hono/hono-base';
6
6
  import * as hono_utils_http_status from 'hono/utils/http-status';
7
7
  import * as hono_utils_types from 'hono/utils/types';
@@ -10,8 +10,8 @@ import * as hono from 'hono';
10
10
  import { Context, MiddlewareHandler } from 'hono';
11
11
  import { Kysely, KyselyPlugin } from 'kysely';
12
12
  import { ReadableStream as ReadableStream$1 } from 'node:stream/web';
13
- import { a as CacheDriver, b as CacheSetOptions, W as Where, c as IntrospectResult, M as MigrateScope, A as AnyAST, V as VarsContext, T as TransactionOptions$1, C as Connection$1 } from './Connection-ZWTDByQ5.js';
14
- export { d as AST, e as ASTType, f as AggregateFunction, B as BaseAST, g as BodyResult, h as CheckConstraintInfo, i as ColumnDef, j as ColumnDiff, k as ColumnInfo, l as ColumnRef, m as CommentInfo, n as ConnectionContextOptions, o as ConnectionMigrator, p as CustomTypesInfo, D as DataLossError, q as DataLossWarning, r as DeleteAST, s as Dialect, t as DiffResult, E as EmbedDef, u as EmbedTransform, v as ExplainOptions, F as FiltersResult, w as ForeignKeyDiff, x as ForeignKeyInfo, y as FunctionInfo, H as HeadersResult, I as IConnectionConfig, z as IndexDiff, G as IndexInfo, J as InsertAST, K as IntrospectOptions, L as JoinDef, N as JoinMap, O as Meta, P as MigrationError, Q as OrderEntry, R as PlanResult, S as PlanStep, U as PlanStepType, X as PreferToken, Y as PrimaryKeyInfo, Z as Qb, _ as QbDelete, $ as QbInsert, a0 as QbSelect, a1 as QbUpdate, a2 as QueryAST, a3 as QueryParamsResult, a4 as RelationNotFoundError, a5 as RouteResult, a6 as RpcAST, a7 as RpcResult, a8 as SchemaDiffResult, a9 as SelectEntry, aa as SelectResult, ab as TableDiff, ac as TableInfo, ad as TextSearchValue, ae as TransformsResult, af as TranslatorConfig, ag as TriggerInfo, ah as UniqueConstraintInfo, ai as UpdateAST, aj as UpsertAST, ak as UpsertResult, al as ViewInfo, am as ViewOptionsMetadata, an as WhereValue, ao as isRef } from './Connection-ZWTDByQ5.js';
13
+ import { a as CacheDriver, b as CacheSetOptions, C as Connection, W as Where, c as IntrospectResult, M as MigrateScope, A as AnyAST, V as VarsContext, T as TransactionOptions$1 } from './Connection-f_d5HhQ0.js';
14
+ export { d as AST, e as ASTType, f as AggregateFunction, B as BaseAST, g as BodyResult, h as CheckConstraintInfo, i as ColumnDef, j as ColumnDiff, k as ColumnInfo, l as ColumnRef, m as CommentInfo, n as ConnectionContextOptions, o as ConnectionMigrator, p as CustomTypesInfo, D as DataLossError, q as DataLossWarning, r as DeleteAST, s as Dialect, t as DiffResult, E as EmbedDef, u as EmbedTransform, v as ExplainOptions, F as FiltersResult, w as ForeignKeyDiff, x as ForeignKeyInfo, y as FunctionInfo, H as HeadersResult, I as IConnectionConfig, z as IndexDiff, G as IndexInfo, J as InsertAST, K as IntrospectOptions, L as JoinDef, N as JoinMap, O as Meta, P as MigrationError, Q as OrderEntry, R as PlanResult, S as PlanStep, U as PlanStepType, X as PreferToken, Y as PrimaryKeyInfo, Z as Qb, _ as QbDelete, $ as QbInsert, a0 as QbSelect, a1 as QbUpdate, a2 as QueryAST, a3 as QueryParamsResult, a4 as RelationNotFoundError, a5 as RouteResult, a6 as RpcAST, a7 as RpcResult, a8 as SchemaDiffResult, a9 as SelectEntry, aa as SelectResult, ab as TableDiff, ac as TableInfo, ad as TextSearchValue, ae as TransformsResult, af as TranslatorConfig, ag as TriggerInfo, ah as UniqueConstraintInfo, ai as UpdateAST, aj as UpsertAST, ak as UpsertResult, al as ViewInfo, am as ViewOptionsMetadata, an as WhereValue, ao as isRef } from './Connection-f_d5HhQ0.js';
15
15
  import { ParseResult } from 'libpg-query';
16
16
  import { DeparserOptions } from 'pgsql-deparser';
17
17
  import 'jsonv-ts';
@@ -198,7 +198,7 @@ interface EmailTemplateConfig {
198
198
  content_path?: string;
199
199
  }
200
200
 
201
- type Dialect$1 = "postgres" | "sqlite";
201
+ type Dialect = "postgres" | "sqlite";
202
202
  /** Bound `Connection#runInTransaction` — see db/Connection.ts for why this
203
203
  * indirection exists (DO storage has no BEGIN/COMMIT over kysely). */
204
204
  type TransactionRunner = <T>(fn: (trx: Kysely<any>) => Promise<T>) => Promise<T>;
@@ -207,7 +207,7 @@ declare class AuthRepository {
207
207
  private dialect;
208
208
  private runInTransaction;
209
209
  private schema;
210
- constructor(db: Kysely<any>, dialect: Dialect$1, runInTransaction?: TransactionRunner);
210
+ constructor(db: Kysely<any>, dialect: Dialect, runInTransaction?: TransactionRunner);
211
211
  private bool;
212
212
  /**
213
213
  * Runs `fn` inside a database transaction, handing it a repository bound to
@@ -706,7 +706,7 @@ interface StorageAdapter<Options extends StorageAdapterOptions = StorageAdapterO
706
706
  uploadObject(bucketName: string, key: string, version: string | undefined, body: CrossReadableStream | Buffer | Uint8Array, contentType: string, cacheControl: string): Promise<ObjectMetadata>;
707
707
  deleteObject(bucket: string, key: string, version: string | undefined): Promise<void>;
708
708
  deleteObjects(bucket: string, prefixes: string[]): Promise<void>;
709
- copyObject(bucket: string, source: string, version: string | undefined, destination: string, destinationVersion: string | undefined): Promise<Pick<ObjectMetadata, "httpStatusCode" | "eTag" | "lastModified">>;
709
+ copyObject(sourceBucket: string, source: string, version: string | undefined, destinationBucket: string, destination: string, destinationVersion: string | undefined): Promise<Pick<ObjectMetadata, "httpStatusCode" | "eTag" | "lastModified">>;
710
710
  headObject(bucket: string, key: string, version: string | undefined): Promise<ObjectMetadata>;
711
711
  privateAssetUrl(bucket: string, key: string, version: string | undefined): Promise<string>;
712
712
  }
@@ -746,7 +746,6 @@ interface TransformationAdapter<Options extends TransformationAdapterOptions = T
746
746
  transformFromUrl?(url: string, options: TransformOptions): Promise<TransformResult>;
747
747
  }
748
748
 
749
- type Dialect = "postgres" | "sqlite";
750
749
  interface Bucket {
751
750
  id: string;
752
751
  name: string;
@@ -782,10 +781,10 @@ interface ListObjectsOptions {
782
781
  search?: string;
783
782
  }
784
783
  declare class StorageRepository {
784
+ private schema;
785
785
  private db;
786
786
  private dialect;
787
- private schema;
788
- constructor(db: Kysely<any>, dialect: Dialect);
787
+ constructor(connection: Connection);
789
788
  private table;
790
789
  private insertInto;
791
790
  private update;
@@ -815,20 +814,22 @@ declare class StorageRepository {
815
814
  name: string;
816
815
  owner?: string | null;
817
816
  owner_id?: string | null;
818
- metadata?: Record<string, unknown>;
819
- user_metadata?: Record<string, unknown>;
817
+ metadata?: Record<string, unknown> | null;
818
+ user_metadata?: Record<string, unknown> | null;
820
819
  version?: string | null;
821
820
  }): Promise<StorageObject>;
822
821
  findObjectById(id: string): Promise<StorageObject | null>;
823
822
  findObjectByPath(bucketId: string, name: string): Promise<StorageObject | null>;
824
823
  listObjects(bucketId: string, prefix?: string, options?: ListObjectsOptions): Promise<StorageObject[]>;
825
824
  updateObject(id: string, updates: Partial<{
825
+ bucket_id: string;
826
826
  name: string;
827
- metadata: Record<string, unknown>;
828
- user_metadata: Record<string, unknown>;
827
+ metadata: Record<string, unknown> | null;
828
+ user_metadata: Record<string, unknown> | null;
829
829
  version: string | null;
830
830
  owner: string | null;
831
831
  owner_id: string | null;
832
+ updated_at: string;
832
833
  }>): Promise<StorageObject | null>;
833
834
  deleteObject(id: string): Promise<void>;
834
835
  deleteObjectsByBucket(bucketId: string): Promise<string[]>;
@@ -838,6 +839,13 @@ declare class StorageRepository {
838
839
  private parseObjectRow;
839
840
  }
840
841
 
842
+ type StorageRole = string;
843
+ interface StorageRequestAuth {
844
+ role: StorageRole;
845
+ sub: string | null;
846
+ jwt: Record<string, unknown> | null;
847
+ }
848
+
841
849
  interface StorageServiceConfig {
842
850
  jwtSecret: string;
843
851
  fileSizeLimit?: number;
@@ -856,8 +864,12 @@ declare class StorageService {
856
864
  private config;
857
865
  private options;
858
866
  private transformationAdapter?;
867
+ private connection?;
859
868
  private initialized;
860
- constructor(repo: StorageRepository, adapter: StorageAdapter, config: StorageServiceConfig, options?: StorageServiceOptions, transformationAdapter?: TransformationAdapter | undefined);
869
+ private access;
870
+ constructor(repo: StorageRepository, adapter: StorageAdapter, config: StorageServiceConfig, options?: StorageServiceOptions, transformationAdapter?: TransformationAdapter | undefined, connection?: Connection | undefined);
871
+ setRequestAuth(auth: StorageRequestAuth, operation?: string): void;
872
+ get requestAuth(): StorageRequestAuth;
861
873
  init(): Promise<void>;
862
874
  createBucket(params: {
863
875
  id: string;
@@ -868,6 +880,7 @@ declare class StorageService {
868
880
  owner?: string | null;
869
881
  }): Promise<Bucket>;
870
882
  getBucket(id: string): Promise<Bucket>;
883
+ getBucketBypass(id: string): Promise<Bucket>;
871
884
  listBuckets(): Promise<Bucket[]>;
872
885
  updateBucket(id: string, updates: {
873
886
  public?: boolean;
@@ -882,32 +895,34 @@ declare class StorageService {
882
895
  contentLength?: number;
883
896
  upsert?: boolean;
884
897
  metadata?: Record<string, unknown>;
885
- owner?: string | null;
886
898
  }): Promise<StorageObject>;
899
+ private uploadInternal;
887
900
  download(bucketId: string, path: string, options?: {
888
901
  transform?: TransformOptions;
889
902
  }): Promise<{
890
903
  body: CrossReadableStream | Blob | Buffer | Uint8Array;
891
904
  metadata: ObjectMetadata;
892
905
  }>;
906
+ private downloadBypass;
907
+ private downloadObject;
893
908
  update(bucketId: string, path: string, body: ReadableStream | Buffer | Uint8Array, options?: {
894
909
  contentType?: string;
895
910
  cacheControl?: string;
896
911
  contentLength?: number;
897
912
  metadata?: Record<string, unknown>;
898
913
  upsert?: boolean;
899
- owner?: string | null;
900
914
  }): Promise<StorageObject>;
901
915
  remove(bucketId: string, paths: string[]): Promise<StorageObject[]>;
902
916
  list(bucketId: string, prefix?: string, options?: ListObjectsOptions): Promise<StorageObject[]>;
903
- move(bucketId: string, fromPath: string, toPath: string): Promise<void>;
904
- copy(bucketId: string, fromPath: string, toPath: string): Promise<{
917
+ move(bucketId: string, fromPath: string, toPath: string, destinationBucketId?: string): Promise<void>;
918
+ copy(bucketId: string, fromPath: string, toPath: string, destinationBucketId?: string, upsert?: boolean): Promise<{
905
919
  key: string;
906
920
  }>;
907
921
  info(bucketId: string, path: string): Promise<StorageObject & {
908
922
  httpMetadata: ObjectMetadata;
909
923
  }>;
910
924
  exists(bucketId: string, path: string): Promise<boolean>;
925
+ private assertBucketRetrievable;
911
926
  createSignedUrl(bucketId: string, path: string, expiresIn: number): Promise<{
912
927
  signedUrl: string;
913
928
  }>;
@@ -916,7 +931,10 @@ declare class StorageService {
916
931
  signedUrl: string;
917
932
  error: string | null;
918
933
  }[]>;
919
- createSignedUploadUrl(bucketId: string, path: string): Promise<{
934
+ createSignedUploadUrl(bucketId: string, path: string, upsert?: boolean, options?: {
935
+ metadata?: Record<string, unknown>;
936
+ userMetadata?: Record<string, unknown>;
937
+ }): Promise<{
920
938
  signedUrl: string;
921
939
  token: string;
922
940
  path: string;
@@ -925,11 +943,34 @@ declare class StorageService {
925
943
  bucket: string;
926
944
  path: string;
927
945
  intent: "download" | "upload";
946
+ owner: string | null;
947
+ upsert: boolean;
948
+ }>;
949
+ downloadSigned(bucketId: string, path: string, options?: {
950
+ transform?: TransformOptions;
951
+ }): Promise<{
952
+ body: CrossReadableStream | Blob | Buffer | Uint8Array;
953
+ metadata: ObjectMetadata;
928
954
  }>;
955
+ uploadSigned(bucketId: string, path: string, body: ReadableStream | Buffer | Uint8Array, options: {
956
+ contentType?: string;
957
+ cacheControl?: string;
958
+ contentLength?: number;
959
+ upsert?: boolean;
960
+ metadata?: Record<string, unknown>;
961
+ owner: string | null;
962
+ }): Promise<StorageObject>;
929
963
  private signStorageToken;
964
+ private uploadPermissionValues;
965
+ private databaseErrorCode;
930
966
  }
931
967
 
968
+ /** Trusted socket metadata supplied by an adapter that owns the listener. */
969
+ type AppRequestContext = {
970
+ peerAddress: string | null;
971
+ };
932
972
  type HonoContext = {
973
+ Bindings: AppRequestContext;
933
974
  Variables: {
934
975
  app: App;
935
976
  authService: AuthService;
@@ -1802,6 +1843,7 @@ declare function createServer(app: App, options?: ServerOptions): hono_hono_base
1802
1843
  input: {
1803
1844
  json: {
1804
1845
  [x: string]: unknown;
1846
+ destinationBucket?: string | undefined;
1805
1847
  bucketId: string;
1806
1848
  sourceKey: string;
1807
1849
  destinationKey: string;
@@ -1820,6 +1862,7 @@ declare function createServer(app: App, options?: ServerOptions): hono_hono_base
1820
1862
  input: {
1821
1863
  json: {
1822
1864
  [x: string]: unknown;
1865
+ destinationBucket?: string | undefined;
1823
1866
  bucketId: string;
1824
1867
  sourceKey: string;
1825
1868
  destinationKey: string;
@@ -2120,6 +2163,7 @@ declare function createServer(app: App, options?: ServerOptions): hono_hono_base
2120
2163
  unique: boolean;
2121
2164
  columns: string[];
2122
2165
  schema: string;
2166
+ sql?: string | undefined;
2123
2167
  }[];
2124
2168
  foreign_keys: {
2125
2169
  table: string;
@@ -2236,7 +2280,7 @@ declare class Policy {
2236
2280
  }
2237
2281
 
2238
2282
  interface IAppConfig extends DefaultSchema {
2239
- connection: Connection | Promise<Connection>;
2283
+ connection: Connection$1 | Promise<Connection$1>;
2240
2284
  rls?: {
2241
2285
  tables: string[];
2242
2286
  policies: Policy[];
@@ -2261,7 +2305,7 @@ interface SystemOptions {
2261
2305
  schemaReconciliation?: "additive" | "full";
2262
2306
  }
2263
2307
  interface DefaultAppConfig extends IAppConfig {
2264
- connection: Connection;
2308
+ connection: Connection$1;
2265
2309
  options?: {
2266
2310
  defaults?: true;
2267
2311
  server?: ServerOptions;
@@ -2269,7 +2313,7 @@ interface DefaultAppConfig extends IAppConfig {
2269
2313
  system?: SystemOptions;
2270
2314
  };
2271
2315
  }
2272
- declare class App<Config extends IAppConfig = DefaultAppConfig, Conn = Config extends IAppConfig ? Config["connection"] extends Connection ? Config["connection"] : Config["connection"] extends Promise<Connection> ? Awaited<Config["connection"]> : Connection : never> {
2316
+ declare class App<Config extends IAppConfig = DefaultAppConfig, Conn = Config extends IAppConfig ? Config["connection"] extends Connection$1 ? Config["connection"] : Config["connection"] extends Promise<Connection$1> ? Awaited<Config["connection"]> : Connection$1 : never> {
2273
2317
  #private;
2274
2318
  private readonly _connection;
2275
2319
  private readonly _rls;
@@ -2304,6 +2348,7 @@ declare class App<Config extends IAppConfig = DefaultAppConfig, Conn = Config ex
2304
2348
  ensureSystemSchema(opts?: {
2305
2349
  force?: boolean;
2306
2350
  }): Promise<void>;
2351
+ hasEnabledSystemBaseSchema(): boolean;
2307
2352
  isValidConfig(config: Schema | DefaultSchema | IAppConfig): boolean;
2308
2353
  getClient<SchemaName extends string = "public">(options?: SupabaseClientOptions<SchemaName> & {
2309
2354
  apikey?: string;
@@ -2354,7 +2399,7 @@ declare class App<Config extends IAppConfig = DefaultAppConfig, Conn = Config ex
2354
2399
  }>;
2355
2400
  } ? Omit<any, "__InternalSupabase">[SchemaName] : never, any>;
2356
2401
  isLocalRequest(request: Request): boolean;
2357
- fetch: (request: Request) => Promise<Response>;
2402
+ fetch: (request: Request, context?: AppRequestContext) => Promise<Response>;
2358
2403
  getInfoJson(): {
2359
2404
  connection: object;
2360
2405
  config: Config;
@@ -2640,16 +2685,16 @@ interface PersistedDeparseInfo {
2640
2685
  comments?: CollectedComment[];
2641
2686
  }
2642
2687
  type SqlitePostgresTranslationResult = Pick<DeparsePostgresDdlResult, "ddl"> & Partial<DeparsePostgresDdlResult>;
2643
- declare abstract class SqliteConnection<Driver = unknown, DB = any, Config extends ISqliteConnectionConfig = ISqliteConnectionConfig> extends Connection<Driver, DB, Config> {
2688
+ declare abstract class SqliteConnection<Driver = unknown, DB = any, Config extends ISqliteConnectionConfig = ISqliteConnectionConfig> extends Connection$1<Driver, DB, Config> {
2644
2689
  #private;
2645
- dialect: Dialect$2;
2690
+ dialect: Dialect$1;
2646
2691
  deserializeRow(row: Record<string, unknown>): Record<string, unknown>;
2647
2692
  constructor(config?: Config);
2648
2693
  /**
2649
2694
  * `opts.strict`: rethrow instead of swallowing a parse failure (default:
2650
2695
  * fail-soft, returning `{}`). The constructor path stays fail-soft — a
2651
- * malformed `App({rls})` config shouldn't crash boot. The deparse-cache
2652
- * restore path (`deparse-cache.ts`) uses `strict: true`: a partially
2696
+ * malformed `App({rls})` config shouldn't crash boot. The runtime metadata
2697
+ * cache restore path uses `strict: true`: a partially
2653
2698
  * corrupt blob (e.g. a valid outer `rls` shape but a broken nested
2654
2699
  * `schema` entry) must NOT silently degrade to "restored with whatever
2655
2700
  * parsed" — that's indistinguishable from "restored with full RLS
@@ -2674,7 +2719,9 @@ declare abstract class SqliteConnection<Driver = unknown, DB = any, Config exten
2674
2719
  static serializeDeparseInfo(info: Partial<SqlitePostgresDeparseInfo> | undefined | null): PersistedDeparseInfo;
2675
2720
  updateDeparseInfo(details: NonNullable<ISqliteConnectionConfig["translation"]>["deparse"]): void;
2676
2721
  protected withSqlitePlugins(add_plugins?: KyselyPlugin[]): KyselyPlugin[];
2677
- translateDdl(ddl: string): Promise<SqlitePostgresTranslationResult>;
2722
+ translateDdl(ddl: string, opts?: {
2723
+ strict?: boolean;
2724
+ }): Promise<SqlitePostgresTranslationResult>;
2678
2725
  introspect(options?: {
2679
2726
  useCache?: boolean;
2680
2727
  postprocess?: boolean;
@@ -2725,7 +2772,7 @@ declare abstract class SqliteConnection<Driver = unknown, DB = any, Config exten
2725
2772
  onPostgrestAST(ast: AnyAST, vars?: VarsContext): Promise<AnyAST>;
2726
2773
  /**
2727
2774
  * Tables known to have RLS enabled in the APPLIED state of this database,
2728
- * without any deparse metadata: the migration history replayed in applied
2775
+ * without any runtime metadata: the migration history replayed in applied
2729
2776
  * order (`rlsEnabledTables`). Empty when ddlDialect isn't postgres or the
2730
2777
  * history isn't readable.
2731
2778
  */
@@ -2783,7 +2830,7 @@ interface MigrationHistoryRow {
2783
2830
  * - `sqlite`: bare sqlite driver — flat `migrations` + `seed_files` tables.
2784
2831
  */
2785
2832
  type HistoryVariant = "pg" | "pg-flat" | "sqlite";
2786
- declare function historyVariant(connection: Connection$1): HistoryVariant;
2833
+ declare function historyVariant(connection: Connection): HistoryVariant;
2787
2834
  /**
2788
2835
  * Idempotent raw-pg DDL for the migration-history system schema, parallel to
2789
2836
  * `getAuthSchemaSql` / `getStorageSchemaSql`. Fed into the system-schema module
@@ -2800,13 +2847,13 @@ declare function getMigrationHistorySchemaSql(variant: HistoryVariant): string;
2800
2847
  * columns on any pre-existing table, THEN create the unique index (which
2801
2848
  * references `idempotency_key`).
2802
2849
  */
2803
- declare function ensureHistoryTable(connection: Connection$1): Promise<void>;
2804
- declare function appliedVersions(connection: Connection$1): Promise<string[]>;
2805
- declare function recordVersion(connection: Connection$1, row: MigrationHistoryRow): Promise<void>;
2806
- declare function removeVersion(connection: Connection$1, version: string): Promise<void>;
2807
- declare function listHistory(connection: Connection$1): Promise<MigrationHistoryRow[]>;
2808
- declare function getVersion(connection: Connection$1, version: string): Promise<MigrationHistoryRow | null>;
2809
- declare function removeVersionsGte(connection: Connection$1, version: string): Promise<void>;
2850
+ declare function ensureHistoryTable(connection: Connection): Promise<void>;
2851
+ declare function appliedVersions(connection: Connection): Promise<string[]>;
2852
+ declare function recordVersion(connection: Connection, row: MigrationHistoryRow): Promise<void>;
2853
+ declare function removeVersion(connection: Connection, version: string): Promise<void>;
2854
+ declare function listHistory(connection: Connection): Promise<MigrationHistoryRow[]>;
2855
+ declare function getVersion(connection: Connection, version: string): Promise<MigrationHistoryRow | null>;
2856
+ declare function removeVersionsGte(connection: Connection, version: string): Promise<void>;
2810
2857
 
2811
2858
  type Primitive = string | number | boolean;
2812
2859
  declare function isPrimitive(value: any): value is Primitive;
@@ -2928,6 +2975,11 @@ declare function parseBigInt(value: BigInt | number): number;
2928
2975
 
2929
2976
  declare function uuid(): string;
2930
2977
 
2978
+ /** True only for IP addresses the OS routes over the local loopback interface. */
2979
+ declare function isLoopbackAddress(address: string): boolean;
2980
+ /** Hostnames that are unambiguously local without a DNS lookup. */
2981
+ declare function isLoopbackHostname(hostname: string): boolean;
2982
+
2931
2983
  declare function getAuthSchemaSql(clean?: boolean): string;
2932
2984
 
2933
2985
  declare const SUPABASE_AUTH_HELPERS_SQL = "\nCREATE SCHEMA IF NOT EXISTS auth;\n\nCREATE OR REPLACE FUNCTION auth.uid() RETURNS UUID AS $$\n SELECT NULLIF(current_setting('request.jwt.claim.sub', true), '')::uuid;\n$$ LANGUAGE SQL STABLE;\n\nCREATE OR REPLACE FUNCTION auth.role() RETURNS TEXT AS $$\n SELECT NULLIF(current_setting('request.jwt.claim.role', true), '');\n$$ LANGUAGE SQL STABLE;\n\nCREATE OR REPLACE FUNCTION auth.email() RETURNS TEXT AS $$\n SELECT NULLIF(current_setting('request.jwt.claim.email', true), '');\n$$ LANGUAGE SQL STABLE;\n\nCREATE OR REPLACE FUNCTION auth.jwt() RETURNS JSONB AS $$\n SELECT COALESCE(\n NULLIF(current_setting('request.jwt.claims', true), ''),\n '{}'\n )::jsonb;\n$$ LANGUAGE SQL STABLE;\n";
@@ -2955,4 +3007,4 @@ declare function isExperimentalEnabled(name: ExperimentalFeature): boolean;
2955
3007
  declare function setExperimental(name: ExperimentalFeature, enabled: boolean): void;
2956
3008
  declare function listEnabledExperimentals(): ExperimentalFeature[];
2957
3009
 
2958
- export { AnyAST, type ApiKeyResolver, type ApiKeyType, App, type AppDrivers, type AppDriversConfig, AwsSesEmailDriver, type AwsSesEmailDriverOptions, type BooleanLike, CacheDriver, CacheSetOptions, CloudConnection, CloudflareKvCacheDriver, type CloudflareKvCacheDriverOptions, Connection$1 as Connection, ConsoleEmailDriver, type ConsoleEmailDriverOptions, type DefaultAppConfig, type EmailDriver, type EmailMessage, type ExperimentalFeature, type GeneratedApiKey, type HistoryVariant, type HonoContext, type IAppConfig, type ICloudConnectionConfig, type ISqliteConnectionConfig, InMemoryEmailDriver, type InMemoryEmailDriverOptions, InMemoryLruCacheDriver, type InMemoryLruCacheDriverOptions, IntrospectResult, InvalidPostgresToSQLiteTranslation, type MatchPattern, type MaybePromise, MigrateScope, type MigrationHistoryRow, NoopSmsDriver, type NoopSmsDriverOptions, type PartialAppDrivers, type PersistedDeparseInfo, Policy, type PolicyCommand, type PolicyData, type PolicyRole, type Primitive, type RedisCacheClient, RedisCacheDriver, type RedisCacheDriverOptions, ResendEmailDriver, type ResendEmailDriverOptions, type ResolvedKey, SELF_HOSTED_PROJECT_REF, SUPABASE_AUTH_HELPERS_SQL, Schema, SendmailEmailDriver, type SendmailEmailDriverOptions, type ServerOptions, type SmsDriver, type SmsMessage, type SmtpAddress, type SmtpCreateTransport, SmtpEmailDriver, type SmtpEmailDriverOptions, type SmtpTransporter, SqliteConnection, type SqlitePostgresDeparseInfo, type SqlitePostgresTranslationResult, type StoredEmailMessage, TransactionOptions$1 as TransactionOptions, UnableToCreateRuntimeConnection, VarsContext, Where, apiKeyType, appliedVersions, assertSmtpSupportedRuntime, buildSmtpMail, buildSmtpTransportOptions, checkPasswordStrength, cleanSql, cloud, createAppDrivers, ensureHistoryTable, ensureVar, filterSearchParams, formatSendmailMessage, fuzzyMatch, generateApiKey, getAuthSchemaSql, getMigrationHistorySchemaSql, getPath, getStatementsArray, getStorageSchemaSql, getVersion, hashApiKey, historyVariant, invariant, isBooleanLike, isBun, isEmail, isEqual, isExperimentalEnabled, isNode, isObject, isPlainObject, isPrimitive, isString, isWorkerd, jsonStringify, listEnabledExperimentals, listHistory, measureTime, mergeObject, mergeObjectWith, normalizeDefault, normalizeSql, normalizeString, normalizeType, objectDiff, omit, params, parseBigInt, patternMatch, pick, pipe, pipeEach, quote, randomString, recordVersion, removeVersion, removeVersionsGte, replacePlaceholders, requireAuth, resolveAuth, setExperimental, setPath, slugify, snakeToPascalWithSpaces, splitSqlStatements, studioRouteHandler, tableStructuralItems, threw, threwAsync, translatePostgresDdl, truncate, trySync, ucFirst, ucFirstAll, uuid };
3010
+ export { AnyAST, type ApiKeyResolver, type ApiKeyType, App, type AppDrivers, type AppDriversConfig, type AppRequestContext, AwsSesEmailDriver, type AwsSesEmailDriverOptions, type BooleanLike, CacheDriver, CacheSetOptions, CloudConnection, CloudflareKvCacheDriver, type CloudflareKvCacheDriverOptions, Connection, ConsoleEmailDriver, type ConsoleEmailDriverOptions, type DefaultAppConfig, type EmailDriver, type EmailMessage, type ExperimentalFeature, type GeneratedApiKey, type HistoryVariant, type HonoContext, type IAppConfig, type ICloudConnectionConfig, type ISqliteConnectionConfig, InMemoryEmailDriver, type InMemoryEmailDriverOptions, InMemoryLruCacheDriver, type InMemoryLruCacheDriverOptions, IntrospectResult, InvalidPostgresToSQLiteTranslation, type MatchPattern, type MaybePromise, MigrateScope, type MigrationHistoryRow, NoopSmsDriver, type NoopSmsDriverOptions, type PartialAppDrivers, type PersistedDeparseInfo, Policy, type PolicyCommand, type PolicyData, type PolicyRole, type Primitive, type RedisCacheClient, RedisCacheDriver, type RedisCacheDriverOptions, ResendEmailDriver, type ResendEmailDriverOptions, type ResolvedKey, SELF_HOSTED_PROJECT_REF, SUPABASE_AUTH_HELPERS_SQL, Schema, SendmailEmailDriver, type SendmailEmailDriverOptions, type ServerOptions, type SmsDriver, type SmsMessage, type SmtpAddress, type SmtpCreateTransport, SmtpEmailDriver, type SmtpEmailDriverOptions, type SmtpTransporter, SqliteConnection, type SqlitePostgresDeparseInfo, type SqlitePostgresTranslationResult, type StoredEmailMessage, TransactionOptions$1 as TransactionOptions, UnableToCreateRuntimeConnection, VarsContext, Where, apiKeyType, appliedVersions, assertSmtpSupportedRuntime, buildSmtpMail, buildSmtpTransportOptions, checkPasswordStrength, cleanSql, cloud, createAppDrivers, ensureHistoryTable, ensureVar, filterSearchParams, formatSendmailMessage, fuzzyMatch, generateApiKey, getAuthSchemaSql, getMigrationHistorySchemaSql, getPath, getStatementsArray, getStorageSchemaSql, getVersion, hashApiKey, historyVariant, invariant, isBooleanLike, isBun, isEmail, isEqual, isExperimentalEnabled, isLoopbackAddress, isLoopbackHostname, isNode, isObject, isPlainObject, isPrimitive, isString, isWorkerd, jsonStringify, listEnabledExperimentals, listHistory, measureTime, mergeObject, mergeObjectWith, normalizeDefault, normalizeSql, normalizeString, normalizeType, objectDiff, omit, params, parseBigInt, patternMatch, pick, pipe, pipeEach, quote, randomString, recordVersion, removeVersion, removeVersionsGte, replacePlaceholders, requireAuth, resolveAuth, setExperimental, setPath, slugify, snakeToPascalWithSpaces, splitSqlStatements, studioRouteHandler, tableStructuralItems, threw, threwAsync, translatePostgresDdl, truncate, trySync, ucFirst, ucFirstAll, uuid };