@storyshelf/db-postgres 0.0.0-stage → 0.5.3
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/LICENSE +21 -0
- package/README.md +18 -2
- package/dist/ddl.d.mts +8 -0
- package/dist/ddl.mjs +321 -0
- package/dist/ddl.mjs.map +1 -0
- package/dist/drizzle-factory-pg.mjs +77 -0
- package/dist/drizzle-factory-pg.mjs.map +1 -0
- package/dist/drizzle-factory.mjs +42 -0
- package/dist/drizzle-factory.mjs.map +1 -0
- package/dist/index.d.mts +50 -0
- package/dist/index.mjs +51 -0
- package/dist/index.mjs.map +1 -0
- package/dist/migrate.mjs +91 -0
- package/dist/migrate.mjs.map +1 -0
- package/dist/neon-http.d.mts +27 -0
- package/dist/neon-http.mjs +66 -0
- package/dist/neon-http.mjs.map +1 -0
- package/dist/neon.d.mts +29 -0
- package/dist/neon.mjs +59 -0
- package/dist/neon.mjs.map +1 -0
- package/dist/pg.d.mts +33 -0
- package/dist/pg.mjs +56 -0
- package/dist/pg.mjs.map +1 -0
- package/dist/pglite.d.mts +28 -0
- package/dist/pglite.mjs +54 -0
- package/dist/pglite.mjs.map +1 -0
- package/dist/schema/baseline.d.mts +197 -0
- package/dist/schema/baseline.mjs +29 -0
- package/dist/schema/baseline.mjs.map +1 -0
- package/dist/schema/build.d.mts +380 -0
- package/dist/schema/build.mjs +39 -0
- package/dist/schema/build.mjs.map +1 -0
- package/dist/schema/capture-attempt.d.mts +445 -0
- package/dist/schema/capture-attempt.mjs +58 -0
- package/dist/schema/capture-attempt.mjs.map +1 -0
- package/dist/schema/comment.d.mts +197 -0
- package/dist/schema/comment.mjs +32 -0
- package/dist/schema/comment.mjs.map +1 -0
- package/dist/schema/content-refs.d.mts +89 -0
- package/dist/schema/content-refs.mjs +22 -0
- package/dist/schema/content-refs.mjs.map +1 -0
- package/dist/schema/label.d.mts +262 -0
- package/dist/schema/label.mjs +36 -0
- package/dist/schema/label.mjs.map +1 -0
- package/dist/schema/member.d.mts +129 -0
- package/dist/schema/member.mjs +23 -0
- package/dist/schema/member.mjs.map +1 -0
- package/dist/schema/notification.d.mts +316 -0
- package/dist/schema/notification.mjs +42 -0
- package/dist/schema/notification.mjs.map +1 -0
- package/dist/schema/project-group-mapping.d.mts +110 -0
- package/dist/schema/project-group-mapping.mjs +21 -0
- package/dist/schema/project-group-mapping.mjs.map +1 -0
- package/dist/schema/project.d.mts +337 -0
- package/dist/schema/project.mjs +35 -0
- package/dist/schema/project.mjs.map +1 -0
- package/dist/schema/snapshot.d.mts +452 -0
- package/dist/schema/snapshot.mjs +47 -0
- package/dist/schema/snapshot.mjs.map +1 -0
- package/dist/schema/status-config.d.mts +143 -0
- package/dist/schema/status-config.mjs +26 -0
- package/dist/schema/status-config.mjs.map +1 -0
- package/dist/schema/token.d.mts +143 -0
- package/dist/schema/token.mjs +27 -0
- package/dist/schema/token.mjs.map +1 -0
- package/dist/schema/user-invite.d.mts +125 -0
- package/dist/schema/user-invite.mjs +28 -0
- package/dist/schema/user-invite.mjs.map +1 -0
- package/dist/schema/user.d.mts +146 -0
- package/dist/schema/user.mjs +25 -0
- package/dist/schema/user.mjs.map +1 -0
- package/dist/schema/webhook.d.mts +143 -0
- package/dist/schema/webhook.mjs +26 -0
- package/dist/schema/webhook.mjs.map +1 -0
- package/dist/schema.d.mts +47 -0
- package/dist/schema.mjs +46 -0
- package/dist/schema.mjs.map +1 -0
- package/dist/vercel.d.mts +26 -0
- package/dist/vercel.mjs +48 -0
- package/dist/vercel.mjs.map +1 -0
- package/package.json +134 -4
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { Build, builds } from "./schema/build.mjs";
|
|
4
|
+
import { CaptureAttempt, CaptureLog, captureAttempts, captureLogs } from "./schema/capture-attempt.mjs";
|
|
5
|
+
import { Baseline, baselines } from "./schema/baseline.mjs";
|
|
6
|
+
import { Comment, comments } from "./schema/comment.mjs";
|
|
7
|
+
import { BuildLabel, LabelType, buildLabels, labelTypes } from "./schema/label.mjs";
|
|
8
|
+
import { ProjectMember, projectMembers } from "./schema/member.mjs";
|
|
9
|
+
import { ProjectGroupMapping, projectGroupMappings } from "./schema/project-group-mapping.mjs";
|
|
10
|
+
import { Project, StorybookMeta, projects } from "./schema/project.mjs";
|
|
11
|
+
import { Snapshot, snapshots } from "./schema/snapshot.mjs";
|
|
12
|
+
import { ProjectStatusConfig, projectStatusConfigs } from "./schema/status-config.mjs";
|
|
13
|
+
import { Token, tokens } from "./schema/token.mjs";
|
|
14
|
+
import { UserInviteToken, userInviteTokens } from "./schema/user-invite.mjs";
|
|
15
|
+
import { User, users } from "./schema/user.mjs";
|
|
16
|
+
import { Webhook, webhooks } from "./schema/webhook.mjs";
|
|
17
|
+
import { NotificationChannel, NotificationSubscription, notificationChannels, notificationSubscriptions } from "./schema/notification.mjs";
|
|
18
|
+
import { ContentRef, contentRefs } from "./schema/content-refs.mjs";
|
|
19
|
+
import { AnyPgTable } from "drizzle-orm/pg-core";
|
|
20
|
+
//#region src/schema/index.d.ts
|
|
21
|
+
/** Full Drizzle schema object passed to the database client. */
|
|
22
|
+
declare const schema: {
|
|
23
|
+
projects: AnyPgTable;
|
|
24
|
+
projectStatusConfigs: AnyPgTable;
|
|
25
|
+
builds: AnyPgTable;
|
|
26
|
+
captureAttempts: AnyPgTable;
|
|
27
|
+
captureLogs: AnyPgTable;
|
|
28
|
+
snapshots: AnyPgTable;
|
|
29
|
+
baselines: AnyPgTable;
|
|
30
|
+
comments: AnyPgTable;
|
|
31
|
+
labelTypes: AnyPgTable;
|
|
32
|
+
buildLabels: AnyPgTable;
|
|
33
|
+
tokens: AnyPgTable;
|
|
34
|
+
webhooks: AnyPgTable;
|
|
35
|
+
notificationChannels: AnyPgTable;
|
|
36
|
+
notificationSubscriptions: AnyPgTable;
|
|
37
|
+
users: AnyPgTable;
|
|
38
|
+
userInviteTokens: AnyPgTable;
|
|
39
|
+
projectMembers: AnyPgTable;
|
|
40
|
+
projectGroupMappings: AnyPgTable;
|
|
41
|
+
contentRefs: AnyPgTable;
|
|
42
|
+
};
|
|
43
|
+
/** The full database schema type. */
|
|
44
|
+
type Schema = typeof schema;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { type Baseline, type Build, type BuildLabel, type CaptureAttempt, type CaptureLog, type Comment, type ContentRef, type LabelType, type NotificationChannel, type NotificationSubscription, type Project, type ProjectGroupMapping, type ProjectMember, type ProjectStatusConfig, Schema, type Snapshot, type StorybookMeta, type Token, type User, type UserInviteToken, type Webhook, baselines, buildLabels, builds, captureAttempts, captureLogs, comments, contentRefs, labelTypes, notificationChannels, notificationSubscriptions, projectGroupMappings, projectMembers, projectStatusConfigs, projects, schema, snapshots, tokens, userInviteTokens, users, webhooks };
|
|
47
|
+
//# sourceMappingURL=schema.d.mts.map
|
package/dist/schema.mjs
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { projects } from "./schema/project.mjs";
|
|
5
|
+
import { baselines } from "./schema/baseline.mjs";
|
|
6
|
+
import { builds } from "./schema/build.mjs";
|
|
7
|
+
import { captureAttempts, captureLogs } from "./schema/capture-attempt.mjs";
|
|
8
|
+
import { snapshots } from "./schema/snapshot.mjs";
|
|
9
|
+
import { users } from "./schema/user.mjs";
|
|
10
|
+
import { comments } from "./schema/comment.mjs";
|
|
11
|
+
import { contentRefs } from "./schema/content-refs.mjs";
|
|
12
|
+
import { buildLabels, labelTypes } from "./schema/label.mjs";
|
|
13
|
+
import { projectMembers } from "./schema/member.mjs";
|
|
14
|
+
import { notificationChannels, notificationSubscriptions } from "./schema/notification.mjs";
|
|
15
|
+
import { projectGroupMappings } from "./schema/project-group-mapping.mjs";
|
|
16
|
+
import { projectStatusConfigs } from "./schema/status-config.mjs";
|
|
17
|
+
import { tokens } from "./schema/token.mjs";
|
|
18
|
+
import { userInviteTokens } from "./schema/user-invite.mjs";
|
|
19
|
+
import { webhooks } from "./schema/webhook.mjs";
|
|
20
|
+
//#region src/schema/index.ts
|
|
21
|
+
/** Full Drizzle schema object passed to the database client. */
|
|
22
|
+
const schema = {
|
|
23
|
+
projects,
|
|
24
|
+
projectStatusConfigs,
|
|
25
|
+
builds,
|
|
26
|
+
captureAttempts,
|
|
27
|
+
captureLogs,
|
|
28
|
+
snapshots,
|
|
29
|
+
baselines,
|
|
30
|
+
comments,
|
|
31
|
+
labelTypes,
|
|
32
|
+
buildLabels,
|
|
33
|
+
tokens,
|
|
34
|
+
webhooks,
|
|
35
|
+
notificationChannels,
|
|
36
|
+
notificationSubscriptions,
|
|
37
|
+
users,
|
|
38
|
+
userInviteTokens,
|
|
39
|
+
projectMembers,
|
|
40
|
+
projectGroupMappings,
|
|
41
|
+
contentRefs
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { baselines, buildLabels, builds, captureAttempts, captureLogs, comments, contentRefs, labelTypes, notificationChannels, notificationSubscriptions, projectGroupMappings, projectMembers, projectStatusConfigs, projects, schema, snapshots, tokens, userInviteTokens, users, webhooks };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=schema.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.mjs","names":["projectsTable","projectStatusConfigsTable","buildsTable","captureAttemptsTable","captureLogsTable","snapshotsTable","baselinesTable","commentsTable","labelTypesTable","buildLabelsTable","tokensTable","webhooksTable","notificationChannelsTable","notificationSubscriptionsTable","usersTable","userInviteTokensTable","projectMembersTable","projectGroupMappingsTable","contentRefsTable"],"sources":["../src/schema/index.ts"],"sourcesContent":["/**\n * Database schema: table handles, row types, and the schema object passed\n * to the database client.\n *\n * Table handles are available on the `schema` object with full type\n * inference (`schema.builds`, …); exact column types live on the narrow\n * per-entity definitions, and the row interfaces are pinned to them by\n * `schema-types.test.ts`.\n */\nimport type { AnyPgTable } from \"drizzle-orm/pg-core\";\nimport { baselines as baselinesTable } from \"./baseline.ts\";\nimport { builds as buildsTable } from \"./build.ts\";\nimport {\n captureAttempts as captureAttemptsTable,\n captureLogs as captureLogsTable,\n} from \"./capture-attempt.ts\";\nimport { comments as commentsTable } from \"./comment.ts\";\nimport { contentRefs as contentRefsTable } from \"./content-refs.ts\";\nimport { buildLabels as buildLabelsTable, labelTypes as labelTypesTable } from \"./label.ts\";\nimport { projectMembers as projectMembersTable } from \"./member.ts\";\nimport {\n notificationChannels as notificationChannelsTable,\n notificationSubscriptions as notificationSubscriptionsTable,\n} from \"./notification.ts\";\nimport { projectGroupMappings as projectGroupMappingsTable } from \"./project-group-mapping.ts\";\nimport { projects as projectsTable } from \"./project.ts\";\nimport { snapshots as snapshotsTable } from \"./snapshot.ts\";\nimport { projectStatusConfigs as projectStatusConfigsTable } from \"./status-config.ts\";\nimport { tokens as tokensTable } from \"./token.ts\";\nimport { userInviteTokens as userInviteTokensTable } from \"./user-invite.ts\";\nimport { users as usersTable } from \"./user.ts\";\nimport { webhooks as webhooksTable } from \"./webhook.ts\";\n\nexport { builds } from \"./build.ts\";\nexport { captureAttempts, captureLogs } from \"./capture-attempt.ts\";\nexport { baselines } from \"./baseline.ts\";\nexport { comments } from \"./comment.ts\";\nexport { buildLabels, labelTypes } from \"./label.ts\";\nexport { projectMembers } from \"./member.ts\";\nexport { projectGroupMappings } from \"./project-group-mapping.ts\";\nexport { projects } from \"./project.ts\";\nexport { snapshots } from \"./snapshot.ts\";\nexport { projectStatusConfigs } from \"./status-config.ts\";\nexport { tokens } from \"./token.ts\";\nexport { userInviteTokens } from \"./user-invite.ts\";\nexport { users } from \"./user.ts\";\nexport { webhooks } from \"./webhook.ts\";\nexport { notificationChannels, notificationSubscriptions } from \"./notification.ts\";\nexport { contentRefs } from \"./content-refs.ts\";\n\n/** A capture attempt and its log lines for a single build run. */\nexport type { CaptureAttempt, CaptureLog } from \"./capture-attempt.ts\";\n/** Build row as stored in the `builds` table. */\nexport type { Build } from \"./build.ts\";\n/** Review comment row as stored in the `comments` table. */\nexport type { Comment } from \"./comment.ts\";\n/** Build label and label type rows. */\nexport type { BuildLabel, LabelType } from \"./label.ts\";\n/** Project membership row linking a user to a project role. */\nexport type { ProjectMember } from \"./member.ts\";\n/** Identity-provider group to project-role mapping row. */\nexport type { ProjectGroupMapping } from \"./project-group-mapping.ts\";\n/** Project row and its embedded Storybook metadata. */\nexport type { Project, StorybookMeta } from \"./project.ts\";\n/** Per-project git provider status-check configuration row. */\nexport type { ProjectStatusConfig } from \"./status-config.ts\";\n/** Snapshot row capturing a single story at one viewport. */\nexport type { Snapshot } from \"./snapshot.ts\";\n/** CI token row (stores only the hash). */\nexport type { Token } from \"./token.ts\";\n/** One-time invite token for local accounts. */\nexport type { UserInviteToken } from \"./user-invite.ts\";\n/** User row for authenticated identities. */\nexport type { User } from \"./user.ts\";\n/** Webhook subscription row. */\nexport type { Webhook } from \"./webhook.ts\";\n/** Notification channel and subscription rows. */\nexport type { NotificationChannel, NotificationSubscription } from \"./notification.ts\";\n/** Baseline row. */\nexport type { Baseline } from \"./baseline.ts\";\n/** Content ref row for deduplicated assets. */\nexport type { ContentRef } from \"./content-refs.ts\";\n\n/** Full Drizzle schema object passed to the database client. */\nexport const schema: {\n projects: AnyPgTable;\n projectStatusConfigs: AnyPgTable;\n builds: AnyPgTable;\n captureAttempts: AnyPgTable;\n captureLogs: AnyPgTable;\n snapshots: AnyPgTable;\n baselines: AnyPgTable;\n comments: AnyPgTable;\n labelTypes: AnyPgTable;\n buildLabels: AnyPgTable;\n tokens: AnyPgTable;\n webhooks: AnyPgTable;\n notificationChannels: AnyPgTable;\n notificationSubscriptions: AnyPgTable;\n users: AnyPgTable;\n userInviteTokens: AnyPgTable;\n projectMembers: AnyPgTable;\n projectGroupMappings: AnyPgTable;\n contentRefs: AnyPgTable;\n} = {\n projects: projectsTable,\n projectStatusConfigs: projectStatusConfigsTable,\n builds: buildsTable,\n captureAttempts: captureAttemptsTable,\n captureLogs: captureLogsTable,\n snapshots: snapshotsTable,\n baselines: baselinesTable,\n comments: commentsTable,\n labelTypes: labelTypesTable,\n buildLabels: buildLabelsTable,\n tokens: tokensTable,\n webhooks: webhooksTable,\n notificationChannels: notificationChannelsTable,\n notificationSubscriptions: notificationSubscriptionsTable,\n users: usersTable,\n userInviteTokens: userInviteTokensTable,\n projectMembers: projectMembersTable,\n projectGroupMappings: projectGroupMappingsTable,\n contentRefs: contentRefsTable,\n};\n\n/** The full database schema type. */\nexport type Schema = typeof schema;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoFA,MAAa,SAoBT;CACQA;CACYC;CACdC;CACSC;CACJC;CACFC;CACAC;CACDC;CACEC;CACCC;CACLC;CACEC;CACYC;CACKC;CACpBC;CACWC;CACFC;CACMC;CACTC;AACf"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { VercelClient } from "@vercel/postgres";
|
|
4
|
+
import { DatabaseAdapter } from "@storyshelf/core/adapter/database";
|
|
5
|
+
//#region src/vercel.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Options for creating a Vercel-backed DatabaseAdapter.
|
|
8
|
+
*
|
|
9
|
+
* With no options, the platform default `sql` client (bound to
|
|
10
|
+
* `POSTGRES_URL`) is used and the caller owns nothing. Pass `client` to
|
|
11
|
+
* inject a preconfigured client instead (teardown stays a no-op either
|
|
12
|
+
* way — the platform owns the connection).
|
|
13
|
+
*/
|
|
14
|
+
interface VercelDatabaseOptions {
|
|
15
|
+
client?: VercelClient;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create a Vercel-backed DatabaseAdapter using Drizzle ORM.
|
|
19
|
+
*
|
|
20
|
+
* @param options - Optionally a preconfigured `@vercel/postgres` client.
|
|
21
|
+
* @returns A DatabaseAdapter backed by Vercel Postgres.
|
|
22
|
+
*/
|
|
23
|
+
declare function createVercelDatabase(options?: VercelDatabaseOptions): DatabaseAdapter;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { VercelDatabaseOptions, createVercelDatabase };
|
|
26
|
+
//# sourceMappingURL=vercel.d.mts.map
|
package/dist/vercel.mjs
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { createDrizzlePgAdapter } from "./drizzle-factory-pg.mjs";
|
|
5
|
+
import { runMigrations } from "./migrate.mjs";
|
|
6
|
+
import { schema } from "./schema.mjs";
|
|
7
|
+
import { sql } from "@vercel/postgres";
|
|
8
|
+
import { drizzle } from "drizzle-orm/vercel-postgres";
|
|
9
|
+
//#region src/vercel.ts
|
|
10
|
+
/**
|
|
11
|
+
* Vercel Postgres preset for the Postgres database adapter.
|
|
12
|
+
*
|
|
13
|
+
* Same schema, DDL, and Drizzle factory as the `postgres.js` default;
|
|
14
|
+
* only the driver differs (`@vercel/postgres`, zero-config on Vercel via
|
|
15
|
+
* `POSTGRES_URL`). Requires the optional `@vercel/postgres` peer
|
|
16
|
+
* (`nub add @vercel/postgres`).
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Create a Vercel-backed DatabaseAdapter using Drizzle ORM.
|
|
20
|
+
*
|
|
21
|
+
* @param options - Optionally a preconfigured `@vercel/postgres` client.
|
|
22
|
+
* @returns A DatabaseAdapter backed by Vercel Postgres.
|
|
23
|
+
*/
|
|
24
|
+
function createVercelDatabase(options = {}) {
|
|
25
|
+
const client = options.client ?? sql;
|
|
26
|
+
const db = drizzle(client, { schema });
|
|
27
|
+
return createDrizzlePgAdapter(db, {
|
|
28
|
+
metadata: {
|
|
29
|
+
name: "Vercel Postgres",
|
|
30
|
+
version: globalThis.__PKG_VERSION__ ?? "0.0.0",
|
|
31
|
+
description: "Vercel Postgres database adapter (@vercel/postgres + Drizzle)",
|
|
32
|
+
kind: "vercel",
|
|
33
|
+
category: "database"
|
|
34
|
+
},
|
|
35
|
+
tables: schema,
|
|
36
|
+
migrate: async () => {
|
|
37
|
+
await runMigrations(async (statement) => (await client.query(statement)).rows);
|
|
38
|
+
},
|
|
39
|
+
close: () => {},
|
|
40
|
+
ping: async () => {
|
|
41
|
+
await client.query("SELECT 1");
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { createVercelDatabase };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=vercel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vercel.mjs","names":[],"sources":["../src/vercel.ts"],"sourcesContent":["import type { DatabaseAdapter } from \"@storyshelf/core/adapter/database\";\n/**\n * Vercel Postgres preset for the Postgres database adapter.\n *\n * Same schema, DDL, and Drizzle factory as the `postgres.js` default;\n * only the driver differs (`@vercel/postgres`, zero-config on Vercel via\n * `POSTGRES_URL`). Requires the optional `@vercel/postgres` peer\n * (`nub add @vercel/postgres`).\n */\nimport { sql, type VercelClient } from \"@vercel/postgres\";\nimport { drizzle } from \"drizzle-orm/vercel-postgres\";\nimport { createDrizzlePgAdapter } from \"./drizzle-factory-pg.ts\";\nimport { runMigrations } from \"./migrate.ts\";\nimport { schema } from \"./schema/index.ts\";\n\ndeclare const __PKG_VERSION__: string | undefined;\n\n/**\n * Options for creating a Vercel-backed DatabaseAdapter.\n *\n * With no options, the platform default `sql` client (bound to\n * `POSTGRES_URL`) is used and the caller owns nothing. Pass `client` to\n * inject a preconfigured client instead (teardown stays a no-op either\n * way — the platform owns the connection).\n */\nexport interface VercelDatabaseOptions {\n client?: VercelClient;\n}\n\n/**\n * Create a Vercel-backed DatabaseAdapter using Drizzle ORM.\n *\n * @param options - Optionally a preconfigured `@vercel/postgres` client.\n * @returns A DatabaseAdapter backed by Vercel Postgres.\n */\nexport function createVercelDatabase(options: VercelDatabaseOptions = {}): DatabaseAdapter {\n const client = options.client ?? sql;\n const db = drizzle(client, { schema });\n\n return createDrizzlePgAdapter(db, {\n metadata: {\n name: \"Vercel Postgres\",\n version: (globalThis as unknown as { __PKG_VERSION__?: string }).__PKG_VERSION__ ?? \"0.0.0\",\n description: \"Vercel Postgres database adapter (@vercel/postgres + Drizzle)\",\n kind: \"vercel\",\n category: \"database\",\n },\n tables: schema,\n migrate: async () => {\n await runMigrations(async (statement) => (await client.query(statement)).rows);\n },\n close: () => {\n // no-op: the platform owns the connection\n },\n ping: async () => {\n await client.query(\"SELECT 1\");\n },\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAAgB,qBAAqB,UAAiC,CAAC,GAAoB;CACzF,MAAM,SAAS,QAAQ,UAAU;CACjC,MAAM,KAAK,QAAQ,QAAQ,EAAE,OAAO,CAAC;CAErC,OAAO,uBAAuB,IAAI;EAChC,UAAU;GACR,MAAM;GACN,SAAU,WAAuD,mBAAmB;GACpF,aAAa;GACb,MAAM;GACN,UAAU;EACZ;EACA,QAAQ;EACR,SAAS,YAAY;GACnB,MAAM,cAAc,OAAO,eAAe,MAAM,OAAO,MAAM,SAAS,EAAA,CAAG,IAAI;EAC/E;EACA,aAAa,CAEb;EACA,MAAM,YAAY;GAChB,MAAM,OAAO,MAAM,UAAU;EAC/B;CACF,CAAC;AACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,136 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyshelf/db-postgres",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.5.3",
|
|
4
|
+
"description": "Postgres database adapter for StoryShelf (postgres.js + Drizzle, RDS/Cloud SQL/Supabase/Neon compatible).",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"database",
|
|
7
|
+
"drizzle",
|
|
8
|
+
"postgres",
|
|
9
|
+
"storybook"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/GuptaSiddhant/StoryShelf#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/GuptaSiddhant/StoryShelf/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "Siddhant Gupta",
|
|
18
|
+
"url": "https://guptasiddhant.com"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/GuptaSiddhant/StoryShelf.git",
|
|
23
|
+
"directory": "packages/db-postgres"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"type": "module",
|
|
29
|
+
"sideEffects": false,
|
|
30
|
+
"types": "./dist/index.d.mts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"source": "./src/index.ts",
|
|
34
|
+
"default": "./dist/index.mjs"
|
|
35
|
+
},
|
|
36
|
+
"./ddl": {
|
|
37
|
+
"source": "./src/ddl.ts",
|
|
38
|
+
"default": "./dist/ddl.mjs"
|
|
39
|
+
},
|
|
40
|
+
"./neon": {
|
|
41
|
+
"source": "./src/neon.ts",
|
|
42
|
+
"default": "./dist/neon.mjs"
|
|
43
|
+
},
|
|
44
|
+
"./neon-http": {
|
|
45
|
+
"source": "./src/neon-http.ts",
|
|
46
|
+
"default": "./dist/neon-http.mjs"
|
|
47
|
+
},
|
|
48
|
+
"./pg": {
|
|
49
|
+
"source": "./src/pg.ts",
|
|
50
|
+
"default": "./dist/pg.mjs"
|
|
51
|
+
},
|
|
52
|
+
"./pglite": {
|
|
53
|
+
"source": "./src/pglite.ts",
|
|
54
|
+
"default": "./dist/pglite.mjs"
|
|
55
|
+
},
|
|
56
|
+
"./schema": {
|
|
57
|
+
"source": "./src/schema/index.ts",
|
|
58
|
+
"default": "./dist/schema.mjs"
|
|
59
|
+
},
|
|
60
|
+
"./vercel": {
|
|
61
|
+
"source": "./src/vercel.ts",
|
|
62
|
+
"default": "./dist/vercel.mjs"
|
|
63
|
+
},
|
|
64
|
+
"./package.json": "./package.json"
|
|
65
|
+
},
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"exports": {
|
|
68
|
+
".": "./dist/index.mjs",
|
|
69
|
+
"./ddl": "./dist/ddl.mjs",
|
|
70
|
+
"./neon": "./dist/neon.mjs",
|
|
71
|
+
"./neon-http": "./dist/neon-http.mjs",
|
|
72
|
+
"./pg": "./dist/pg.mjs",
|
|
73
|
+
"./pglite": "./dist/pglite.mjs",
|
|
74
|
+
"./schema": "./dist/schema.mjs",
|
|
75
|
+
"./vercel": "./dist/vercel.mjs",
|
|
76
|
+
"./package.json": "./package.json"
|
|
77
|
+
},
|
|
78
|
+
"access": "public"
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"build": "tsdown",
|
|
82
|
+
"dev": "tsdown -w",
|
|
83
|
+
"fmt": "oxfmt ./src",
|
|
84
|
+
"lint": "oxlint --type-aware --type-check ./src",
|
|
85
|
+
"test": "vitest run",
|
|
86
|
+
"prepublishOnly": "nub run build"
|
|
87
|
+
},
|
|
88
|
+
"dependencies": {
|
|
89
|
+
"@storyshelf/core": "0.5.3",
|
|
90
|
+
"drizzle-orm": "^0.44.0",
|
|
91
|
+
"postgres": "^3.4.0"
|
|
92
|
+
},
|
|
93
|
+
"devDependencies": {
|
|
94
|
+
"@electric-sql/pglite": "^0.5.8",
|
|
95
|
+
"@neondatabase/serverless": "^1.1.0",
|
|
96
|
+
"@types/node": "^26.0.0",
|
|
97
|
+
"@vercel/postgres": "^0.10.0",
|
|
98
|
+
"@vitest/coverage-v8": "^4.0.0",
|
|
99
|
+
"oxfmt": "^0.65.0",
|
|
100
|
+
"oxlint": "^1.80.0",
|
|
101
|
+
"oxlint-tsgolint": "^7.0.2001",
|
|
102
|
+
"pg": "^8.0.0",
|
|
103
|
+
"tsdown": "^0.22.14",
|
|
104
|
+
"typescript": "^7.0.2",
|
|
105
|
+
"vitest": "^5.0.0"
|
|
106
|
+
},
|
|
107
|
+
"peerDependencies": {
|
|
108
|
+
"@electric-sql/pglite": "^0.5.8",
|
|
109
|
+
"@neondatabase/serverless": "^1.1.0",
|
|
110
|
+
"@vercel/postgres": "^0.10.0",
|
|
111
|
+
"pg": "^8.0.0"
|
|
112
|
+
},
|
|
113
|
+
"peerDependenciesMeta": {
|
|
114
|
+
"pg": {
|
|
115
|
+
"optional": true
|
|
116
|
+
},
|
|
117
|
+
"@neondatabase/serverless": {
|
|
118
|
+
"optional": true
|
|
119
|
+
},
|
|
120
|
+
"@vercel/postgres": {
|
|
121
|
+
"optional": true
|
|
122
|
+
},
|
|
123
|
+
"@electric-sql/pglite": {
|
|
124
|
+
"optional": true
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"jsr": {
|
|
128
|
+
"runtimeCompat": {
|
|
129
|
+
"node": true,
|
|
130
|
+
"deno": true,
|
|
131
|
+
"browser": false,
|
|
132
|
+
"workerd": false,
|
|
133
|
+
"bun": true
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|