@dudousxd/nestjs-media-database-drizzle 0.1.0 → 0.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/dist/index.cjs CHANGED
@@ -22,6 +22,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
22
22
  var index_exports = {};
23
23
  __export(index_exports, {
24
24
  DrizzleMediaStore: () => DrizzleMediaStore,
25
+ attachment: () => attachment,
25
26
  createMediaTable: () => createMediaTable,
26
27
  mediaTable: () => mediaTable
27
28
  });
@@ -114,9 +115,25 @@ var DrizzleMediaStore = class {
114
115
  return top == null ? 0 : Number(top) + 1;
115
116
  }
116
117
  };
118
+
119
+ // src/attachment.column.ts
120
+ var import_nestjs_media_core = require("@dudousxd/nestjs-media-core");
121
+ var import_sqlite_core2 = require("drizzle-orm/sqlite-core");
122
+ var attachment = (0, import_sqlite_core2.customType)({
123
+ dataType() {
124
+ return "text";
125
+ },
126
+ toDriver(value) {
127
+ return JSON.stringify(value ? value.toJSON() : null);
128
+ },
129
+ fromDriver(value) {
130
+ return import_nestjs_media_core.Attachment.fromJSON(value ? JSON.parse(value) : null);
131
+ }
132
+ });
117
133
  // Annotate the CommonJS export names for ESM import in node:
118
134
  0 && (module.exports = {
119
135
  DrizzleMediaStore,
136
+ attachment,
120
137
  createMediaTable,
121
138
  mediaTable
122
139
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/media.schema.ts","../src/drizzle-media-store.ts"],"sourcesContent":["export * from './media.schema';\nexport * from './drizzle-media-store';\n","import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core';\n\n/**\n * Drizzle (sqlite) media table. `order` maps to the `position` column. JSON columns\n * use text(mode:'json'). Postgres/MySQL variants follow the same shape via their\n * respective drizzle cores.\n */\nexport const mediaTable = sqliteTable('media', {\n id: text('id').primaryKey(),\n ownerType: text('owner_type').notNull(),\n ownerId: text('owner_id').notNull(),\n collection: text('collection').notNull(),\n name: text('name').notNull(),\n fileName: text('file_name').notNull(),\n mimeType: text('mime_type').notNull(),\n size: integer('size').notNull(),\n disk: text('disk').notNull(),\n path: text('path').notNull(),\n order: integer('position').notNull(),\n customProperties: text('custom_properties', { mode: 'json' }).notNull(),\n conversions: text('conversions', { mode: 'json' }).notNull(),\n createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(),\n updatedAt: integer('updated_at', { mode: 'timestamp_ms' }).notNull(),\n});\n","import type { MediaRecord, MediaStore } from '@dudousxd/nestjs-media-core';\nimport { and, asc, eq, max, sql } from 'drizzle-orm';\nimport type { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';\nimport { mediaTable } from './media.schema';\n\ntype DB = BetterSQLite3Database<Record<string, never>>;\n\n/**\n * Migration-first (§3.10): Drizzle has no auto-ensure. Run migrations with\n * drizzle-kit in production; this helper creates the table for tests/dev.\n */\nexport function createMediaTable(db: DB): void {\n db.run(sql`\n CREATE TABLE IF NOT EXISTS media (\n id text PRIMARY KEY NOT NULL,\n owner_type text NOT NULL,\n owner_id text NOT NULL,\n collection text NOT NULL,\n name text NOT NULL,\n file_name text NOT NULL,\n mime_type text NOT NULL,\n size integer NOT NULL,\n disk text NOT NULL,\n path text NOT NULL,\n position integer NOT NULL,\n custom_properties text NOT NULL,\n conversions text NOT NULL,\n created_at integer NOT NULL,\n updated_at integer NOT NULL\n )\n `);\n}\n\n/** MediaStore backed by Drizzle (better-sqlite3). POJO receiving the drizzle db. */\nexport class DrizzleMediaStore implements MediaStore {\n constructor(private readonly db: DB) {}\n\n async save(record: MediaRecord): Promise<MediaRecord> {\n await this.db\n .insert(mediaTable)\n .values(record)\n .onConflictDoUpdate({ target: mediaTable.id, set: record });\n return record;\n }\n\n async find(id: string): Promise<MediaRecord | null> {\n const rows = await this.db.select().from(mediaTable).where(eq(mediaTable.id, id)).limit(1);\n return (rows[0] as MediaRecord | undefined) ?? null;\n }\n\n async listByOwner(\n ownerType: string,\n ownerId: string,\n collection?: string,\n ): Promise<MediaRecord[]> {\n const where =\n collection === undefined\n ? and(eq(mediaTable.ownerType, ownerType), eq(mediaTable.ownerId, ownerId))\n : and(\n eq(mediaTable.ownerType, ownerType),\n eq(mediaTable.ownerId, ownerId),\n eq(mediaTable.collection, collection),\n );\n const rows = await this.db\n .select()\n .from(mediaTable)\n .where(where)\n .orderBy(asc(mediaTable.order));\n return rows as MediaRecord[];\n }\n\n async delete(id: string): Promise<void> {\n await this.db.delete(mediaTable).where(eq(mediaTable.id, id));\n }\n\n async nextOrder(ownerType: string, ownerId: string, collection: string): Promise<number> {\n const rows = await this.db\n .select({ max: max(mediaTable.order) })\n .from(mediaTable)\n .where(\n and(\n eq(mediaTable.ownerType, ownerType),\n eq(mediaTable.ownerId, ownerId),\n eq(mediaTable.collection, collection),\n ),\n );\n const top = rows[0]?.max;\n return top == null ? 0 : Number(top) + 1;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;ACAA,yBAA2C;AAOpC,IAAMA,iBAAaC,gCAAY,SAAS;EAC7CC,QAAIC,yBAAK,IAAA,EAAMC,WAAU;EACzBC,eAAWF,yBAAK,YAAA,EAAcG,QAAO;EACrCC,aAASJ,yBAAK,UAAA,EAAYG,QAAO;EACjCE,gBAAYL,yBAAK,YAAA,EAAcG,QAAO;EACtCG,UAAMN,yBAAK,MAAA,EAAQG,QAAO;EAC1BI,cAAUP,yBAAK,WAAA,EAAaG,QAAO;EACnCK,cAAUR,yBAAK,WAAA,EAAaG,QAAO;EACnCM,UAAMC,4BAAQ,MAAA,EAAQP,QAAO;EAC7BQ,UAAMX,yBAAK,MAAA,EAAQG,QAAO;EAC1BS,UAAMZ,yBAAK,MAAA,EAAQG,QAAO;EAC1BU,WAAOH,4BAAQ,UAAA,EAAYP,QAAO;EAClCW,sBAAkBd,yBAAK,qBAAqB;IAAEe,MAAM;EAAO,CAAA,EAAGZ,QAAO;EACrEa,iBAAahB,yBAAK,eAAe;IAAEe,MAAM;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AAG6B,OAAOtB,UAAAA,EAAYU,UAAMC,uBAAGX,WAAWI,IAAIA,EAAAA,CAAAA;EAC3D;EAEA,MAAMmB,UAAUT,WAAmBC,SAAiBC,YAAqC;AACvF,UAAMT,OAAO,MAAM,KAAKd,GACrBe,OAAO;MAAEgB,SAAKA,wBAAIxB,WAAWqB,KAAK;IAAE,CAAA,EACpCZ,KAAKT,UAAAA,EACLU,UACCQ,4BACEP,uBAAGX,WAAWc,WAAWA,SAAAA,OACzBH,uBAAGX,WAAWe,SAASA,OAAAA,OACvBJ,uBAAGX,WAAWgB,YAAYA,UAAAA,CAAAA,CAAAA;AAGhC,UAAMS,MAAMlB,KAAK,CAAA,GAAIiB;AACrB,WAAOC,OAAO,OAAO,IAAIC,OAAOD,GAAAA,IAAO;EACzC;AACF;","names":["mediaTable","sqliteTable","id","text","primaryKey","ownerType","notNull","ownerId","collection","name","fileName","mimeType","size","integer","disk","path","order","customProperties","mode","conversions","createdAt","updatedAt","createMediaTable","db","run","sql","DrizzleMediaStore","save","record","insert","mediaTable","values","onConflictDoUpdate","target","id","set","find","rows","select","from","where","eq","limit","listByOwner","ownerType","ownerId","collection","undefined","and","orderBy","asc","order","delete","nextOrder","max","top","Number"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/media.schema.ts","../src/drizzle-media-store.ts","../src/attachment.column.ts"],"sourcesContent":["export * from './media.schema';\nexport * from './drizzle-media-store';\nexport * from './attachment.column';\n","import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core';\n\n/**\n * Drizzle (sqlite) media table. `order` maps to the `position` column. JSON columns\n * use text(mode:'json'). Postgres/MySQL variants follow the same shape via their\n * respective drizzle cores.\n */\nexport const mediaTable = sqliteTable('media', {\n id: text('id').primaryKey(),\n ownerType: text('owner_type').notNull(),\n ownerId: text('owner_id').notNull(),\n collection: text('collection').notNull(),\n name: text('name').notNull(),\n fileName: text('file_name').notNull(),\n mimeType: text('mime_type').notNull(),\n size: integer('size').notNull(),\n disk: text('disk').notNull(),\n path: text('path').notNull(),\n order: integer('position').notNull(),\n customProperties: text('custom_properties', { mode: 'json' }).notNull(),\n conversions: text('conversions', { mode: 'json' }).notNull(),\n createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(),\n updatedAt: integer('updated_at', { mode: 'timestamp_ms' }).notNull(),\n});\n","import type { MediaRecord, MediaStore } from '@dudousxd/nestjs-media-core';\nimport { and, asc, eq, max, sql } from 'drizzle-orm';\nimport type { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';\nimport { mediaTable } from './media.schema';\n\ntype DB = BetterSQLite3Database<Record<string, never>>;\n\n/**\n * Migration-first (§3.10): Drizzle has no auto-ensure. Run migrations with\n * drizzle-kit in production; this helper creates the table for tests/dev.\n */\nexport function createMediaTable(db: DB): void {\n db.run(sql`\n CREATE TABLE IF NOT EXISTS media (\n id text PRIMARY KEY NOT NULL,\n owner_type text NOT NULL,\n owner_id text NOT NULL,\n collection text NOT NULL,\n name text NOT NULL,\n file_name text NOT NULL,\n mime_type text NOT NULL,\n size integer NOT NULL,\n disk text NOT NULL,\n path text NOT NULL,\n position integer NOT NULL,\n custom_properties text NOT NULL,\n conversions text NOT NULL,\n created_at integer NOT NULL,\n updated_at integer NOT NULL\n )\n `);\n}\n\n/** MediaStore backed by Drizzle (better-sqlite3). POJO receiving the drizzle db. */\nexport class DrizzleMediaStore implements MediaStore {\n constructor(private readonly db: DB) {}\n\n async save(record: MediaRecord): Promise<MediaRecord> {\n await this.db\n .insert(mediaTable)\n .values(record)\n .onConflictDoUpdate({ target: mediaTable.id, set: record });\n return record;\n }\n\n async find(id: string): Promise<MediaRecord | null> {\n const rows = await this.db.select().from(mediaTable).where(eq(mediaTable.id, id)).limit(1);\n return (rows[0] as MediaRecord | undefined) ?? null;\n }\n\n async listByOwner(\n ownerType: string,\n ownerId: string,\n collection?: string,\n ): Promise<MediaRecord[]> {\n const where =\n collection === undefined\n ? and(eq(mediaTable.ownerType, ownerType), eq(mediaTable.ownerId, ownerId))\n : and(\n eq(mediaTable.ownerType, ownerType),\n eq(mediaTable.ownerId, ownerId),\n eq(mediaTable.collection, collection),\n );\n const rows = await this.db\n .select()\n .from(mediaTable)\n .where(where)\n .orderBy(asc(mediaTable.order));\n return rows as MediaRecord[];\n }\n\n async delete(id: string): Promise<void> {\n await this.db.delete(mediaTable).where(eq(mediaTable.id, id));\n }\n\n async nextOrder(ownerType: string, ownerId: string, collection: string): Promise<number> {\n const rows = await this.db\n .select({ max: max(mediaTable.order) })\n .from(mediaTable)\n .where(\n and(\n eq(mediaTable.ownerType, ownerType),\n eq(mediaTable.ownerId, ownerId),\n eq(mediaTable.collection, collection),\n ),\n );\n const top = rows[0]?.max;\n return top == null ? 0 : Number(top) + 1;\n }\n}\n","import { Attachment, type AttachmentData } from '@dudousxd/nestjs-media-core';\nimport { customType } from 'drizzle-orm/sqlite-core';\n\n/**\n * Drizzle (sqlite) custom column for an Attachment value:\n * `avatar: attachment('avatar')` → stored as JSON text, rehydrated to an `Attachment`.\n */\nexport const attachment = customType<{ data: Attachment | null; driverData: string }>({\n dataType() {\n return 'text';\n },\n toDriver(value: Attachment | null): string {\n return JSON.stringify(value ? value.toJSON() : null);\n },\n fromDriver(value: string): Attachment | null {\n return Attachment.fromJSON(value ? (JSON.parse(value) as AttachmentData) : null);\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA,yBAA2C;AAOpC,IAAMA,iBAAaC,gCAAY,SAAS;EAC7CC,QAAIC,yBAAK,IAAA,EAAMC,WAAU;EACzBC,eAAWF,yBAAK,YAAA,EAAcG,QAAO;EACrCC,aAASJ,yBAAK,UAAA,EAAYG,QAAO;EACjCE,gBAAYL,yBAAK,YAAA,EAAcG,QAAO;EACtCG,UAAMN,yBAAK,MAAA,EAAQG,QAAO;EAC1BI,cAAUP,yBAAK,WAAA,EAAaG,QAAO;EACnCK,cAAUR,yBAAK,WAAA,EAAaG,QAAO;EACnCM,UAAMC,4BAAQ,MAAA,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AASA,OAAAA,OACvBJ,uBAAGX,WAAWgB,YAAYA,UAAAA,CAAAA;AAElC,UAAMT,OAAO,MAAM,KAAKd,GACrBe,OAAM,EACNC,KAAKT,UAAAA,EACLU,MAAMA,KAAAA,EACNS,YAAQC,wBAAIpB,WAAWqB,KAAK,CAAA;AAC/B,WAAOd;EACT;EAEA,MAAMe,OAAOlB,IAA2B;AACtC,UAAM,KAAKX,GAAG6B,OAAOtB,UAAAA,EAAYU,UAAMC,uBAAGX,WAAWI,IAAIA,EAAAA,CAAAA;EAC3D;EAEA,MAAMmB,UAAUT,WAAmBC,SAAiBC,YAAqC;AACvF,UAAMT,OAAO,MAAM,KAAKd,GACrBe,OAAO;MAAEgB,SAAKA,wBAAIxB,WAAWqB,KAAK;IAAE,CAAA,EACpCZ,KAAKT,UAAAA,EACLU,UACCQ,4BACEP,uBAAGX,WAAWc,WAAWA,SAAAA,OACzBH,uBAAGX,WAAWe,SAASA,OAAAA,OACvBJ,uBAAGX,WAAWgB,YAAYA,UAAAA,CAAAA,CAAAA;AAGhC,UAAMS,MAAMlB,KAAK,CAAA,GAAIiB;AACrB,WAAOC,OAAO,OAAO,IAAIC,OAAOD,GAAAA,IAAO;EACzC;AACF;;;ACzFA,+BAAgD;AAChD,IAAAE,sBAA2B;AAMpB,IAAMC,iBAAaC,gCAA4D;EACpFC,WAAAA;AACE,WAAO;EACT;EACAC,SAASC,OAAwB;AAC/B,WAAOC,KAAKC,UAAUF,QAAQA,MAAMG,OAAM,IAAK,IAAA;EACjD;EACAC,WAAWJ,OAAa;AACtB,WAAOK,oCAAWC,SAASN,QAASC,KAAKM,MAAMP,KAAAA,IAA4B,IAAA;EAC7E;AACF,CAAA;","names":["mediaTable","sqliteTable","id","text","primaryKey","ownerType","notNull","ownerId","collection","name","fileName","mimeType","size","integer","disk","path","order","customProperties","mode","conversions","createdAt","updatedAt","createMediaTable","db","run","sql","DrizzleMediaStore","save","record","insert","mediaTable","values","onConflictDoUpdate","target","id","set","find","rows","select","from","where","eq","limit","listByOwner","ownerType","ownerId","collection","undefined","and","orderBy","asc","order","delete","nextOrder","max","top","Number","import_sqlite_core","attachment","customType","dataType","toDriver","value","JSON","stringify","toJSON","fromDriver","Attachment","fromJSON","parse"]}
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
2
- import { MediaStore, MediaRecord } from '@dudousxd/nestjs-media-core';
2
+ import { MediaStore, MediaRecord, Attachment } from '@dudousxd/nestjs-media-core';
3
3
  import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
4
4
 
5
5
  /**
@@ -305,4 +305,35 @@ declare class DrizzleMediaStore implements MediaStore {
305
305
  nextOrder(ownerType: string, ownerId: string, collection: string): Promise<number>;
306
306
  }
307
307
 
308
- export { DrizzleMediaStore, createMediaTable, mediaTable };
308
+ /**
309
+ * Drizzle (sqlite) custom column for an Attachment value:
310
+ * `avatar: attachment('avatar')` → stored as JSON text, rehydrated to an `Attachment`.
311
+ */
312
+ declare const attachment: {
313
+ (): drizzle_orm_sqlite_core.SQLiteCustomColumnBuilder<{
314
+ name: "";
315
+ dataType: "custom";
316
+ columnType: "SQLiteCustomColumn";
317
+ data: Attachment | null;
318
+ driverParam: string;
319
+ enumValues: undefined;
320
+ }>;
321
+ <TConfig extends Record<string, any>>(fieldConfig?: TConfig | undefined): drizzle_orm_sqlite_core.SQLiteCustomColumnBuilder<{
322
+ name: "";
323
+ dataType: "custom";
324
+ columnType: "SQLiteCustomColumn";
325
+ data: Attachment | null;
326
+ driverParam: string;
327
+ enumValues: undefined;
328
+ }>;
329
+ <TName extends string>(dbName: TName, fieldConfig?: unknown): drizzle_orm_sqlite_core.SQLiteCustomColumnBuilder<{
330
+ name: TName;
331
+ dataType: "custom";
332
+ columnType: "SQLiteCustomColumn";
333
+ data: Attachment | null;
334
+ driverParam: string;
335
+ enumValues: undefined;
336
+ }>;
337
+ };
338
+
339
+ export { DrizzleMediaStore, attachment, createMediaTable, mediaTable };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
2
- import { MediaStore, MediaRecord } from '@dudousxd/nestjs-media-core';
2
+ import { MediaStore, MediaRecord, Attachment } from '@dudousxd/nestjs-media-core';
3
3
  import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
4
4
 
5
5
  /**
@@ -305,4 +305,35 @@ declare class DrizzleMediaStore implements MediaStore {
305
305
  nextOrder(ownerType: string, ownerId: string, collection: string): Promise<number>;
306
306
  }
307
307
 
308
- export { DrizzleMediaStore, createMediaTable, mediaTable };
308
+ /**
309
+ * Drizzle (sqlite) custom column for an Attachment value:
310
+ * `avatar: attachment('avatar')` → stored as JSON text, rehydrated to an `Attachment`.
311
+ */
312
+ declare const attachment: {
313
+ (): drizzle_orm_sqlite_core.SQLiteCustomColumnBuilder<{
314
+ name: "";
315
+ dataType: "custom";
316
+ columnType: "SQLiteCustomColumn";
317
+ data: Attachment | null;
318
+ driverParam: string;
319
+ enumValues: undefined;
320
+ }>;
321
+ <TConfig extends Record<string, any>>(fieldConfig?: TConfig | undefined): drizzle_orm_sqlite_core.SQLiteCustomColumnBuilder<{
322
+ name: "";
323
+ dataType: "custom";
324
+ columnType: "SQLiteCustomColumn";
325
+ data: Attachment | null;
326
+ driverParam: string;
327
+ enumValues: undefined;
328
+ }>;
329
+ <TName extends string>(dbName: TName, fieldConfig?: unknown): drizzle_orm_sqlite_core.SQLiteCustomColumnBuilder<{
330
+ name: TName;
331
+ dataType: "custom";
332
+ columnType: "SQLiteCustomColumn";
333
+ data: Attachment | null;
334
+ driverParam: string;
335
+ enumValues: undefined;
336
+ }>;
337
+ };
338
+
339
+ export { DrizzleMediaStore, attachment, createMediaTable, mediaTable };
package/dist/index.js CHANGED
@@ -88,8 +88,24 @@ var DrizzleMediaStore = class {
88
88
  return top == null ? 0 : Number(top) + 1;
89
89
  }
90
90
  };
91
+
92
+ // src/attachment.column.ts
93
+ import { Attachment } from "@dudousxd/nestjs-media-core";
94
+ import { customType } from "drizzle-orm/sqlite-core";
95
+ var attachment = customType({
96
+ dataType() {
97
+ return "text";
98
+ },
99
+ toDriver(value) {
100
+ return JSON.stringify(value ? value.toJSON() : null);
101
+ },
102
+ fromDriver(value) {
103
+ return Attachment.fromJSON(value ? JSON.parse(value) : null);
104
+ }
105
+ });
91
106
  export {
92
107
  DrizzleMediaStore,
108
+ attachment,
93
109
  createMediaTable,
94
110
  mediaTable
95
111
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/media.schema.ts","../src/drizzle-media-store.ts"],"sourcesContent":["import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core';\n\n/**\n * Drizzle (sqlite) media table. `order` maps to the `position` column. JSON columns\n * use text(mode:'json'). Postgres/MySQL variants follow the same shape via their\n * respective drizzle cores.\n */\nexport const mediaTable = sqliteTable('media', {\n id: text('id').primaryKey(),\n ownerType: text('owner_type').notNull(),\n ownerId: text('owner_id').notNull(),\n collection: text('collection').notNull(),\n name: text('name').notNull(),\n fileName: text('file_name').notNull(),\n mimeType: text('mime_type').notNull(),\n size: integer('size').notNull(),\n disk: text('disk').notNull(),\n path: text('path').notNull(),\n order: integer('position').notNull(),\n customProperties: text('custom_properties', { mode: 'json' }).notNull(),\n conversions: text('conversions', { mode: 'json' }).notNull(),\n createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(),\n updatedAt: integer('updated_at', { mode: 'timestamp_ms' }).notNull(),\n});\n","import type { MediaRecord, MediaStore } from '@dudousxd/nestjs-media-core';\nimport { and, asc, eq, max, sql } from 'drizzle-orm';\nimport type { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';\nimport { mediaTable } from './media.schema';\n\ntype DB = BetterSQLite3Database<Record<string, never>>;\n\n/**\n * Migration-first (§3.10): Drizzle has no auto-ensure. Run migrations with\n * drizzle-kit in production; this helper creates the table for tests/dev.\n */\nexport function createMediaTable(db: DB): void {\n db.run(sql`\n CREATE TABLE IF NOT EXISTS media (\n id text PRIMARY KEY NOT NULL,\n owner_type text NOT NULL,\n owner_id text NOT NULL,\n collection text NOT NULL,\n name text NOT NULL,\n file_name text NOT NULL,\n mime_type text NOT NULL,\n size integer NOT NULL,\n disk text NOT NULL,\n path text NOT NULL,\n position integer NOT NULL,\n custom_properties text NOT NULL,\n conversions text NOT NULL,\n created_at integer NOT NULL,\n updated_at integer NOT NULL\n )\n `);\n}\n\n/** MediaStore backed by Drizzle (better-sqlite3). POJO receiving the drizzle db. */\nexport class DrizzleMediaStore implements MediaStore {\n constructor(private readonly db: DB) {}\n\n async save(record: MediaRecord): Promise<MediaRecord> {\n await this.db\n .insert(mediaTable)\n .values(record)\n .onConflictDoUpdate({ target: mediaTable.id, set: record });\n return record;\n }\n\n async find(id: string): Promise<MediaRecord | null> {\n const rows = await this.db.select().from(mediaTable).where(eq(mediaTable.id, id)).limit(1);\n return (rows[0] as MediaRecord | undefined) ?? null;\n }\n\n async listByOwner(\n ownerType: string,\n ownerId: string,\n collection?: string,\n ): Promise<MediaRecord[]> {\n const where =\n collection === undefined\n ? and(eq(mediaTable.ownerType, ownerType), eq(mediaTable.ownerId, ownerId))\n : and(\n eq(mediaTable.ownerType, ownerType),\n eq(mediaTable.ownerId, ownerId),\n eq(mediaTable.collection, collection),\n );\n const rows = await this.db\n .select()\n .from(mediaTable)\n .where(where)\n .orderBy(asc(mediaTable.order));\n return rows as MediaRecord[];\n }\n\n async delete(id: string): Promise<void> {\n await this.db.delete(mediaTable).where(eq(mediaTable.id, id));\n }\n\n async nextOrder(ownerType: string, ownerId: string, collection: string): Promise<number> {\n const rows = await this.db\n .select({ max: max(mediaTable.order) })\n .from(mediaTable)\n .where(\n and(\n eq(mediaTable.ownerType, ownerType),\n eq(mediaTable.ownerId, ownerId),\n eq(mediaTable.collection, collection),\n ),\n );\n const top = rows[0]?.max;\n return top == null ? 0 : Number(top) + 1;\n }\n}\n"],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F,IAAyC;AAClD,UAAMG,OAAO,MAAM,KAAKd,GAAGe,OAAM,EAAGC,KAAKT,UAAAA,EAAYU,MAAMC,GAAGX,WAAWI,IAAIA,EAAAA,CAAAA,EAAKQ,MAAM,CAAA;AACxF,WAAQL,KAAK,CAAA,KAAkC;EACjD;EAEA,MAAMM,YACJC,WACAC,SACAC,YACwB;AACxB,UAAMN,QACJM,eAAeC,SACXC,IAAIP,GAAGX,WAAWc,WAAWA,SAAAA,GAAYH,GAAGX,WAAWe,SAASA,OAAAA,CAAAA,IAChEG,IACEP,GAAGX,WAAWc,WAAWA,SAAAA,GACzBH,GAAGX,WAAWe,SAASA,OAAAA,GACvBJ,GAAGX,WAAWgB,YAAYA,UAAAA,CAAAA;AAElC,UAAMT,OAAO,MAAM,KAAKd,GACrBe,OAAM,EACNC,KAAKT,UAAAA,EACLU,MAAMA,KAAAA,EACNS,QAAQC,IAAIpB,WAAWqB,KAAK,CAAA;AAC/B,WAAOd;EACT;EAEA,MAAMe,OAAOlB,IAA2B;AACtC,UAAM,KAAKX,GAAG6B,OAAOtB,UAAAA,EAAYU,MAAMC,GAAGX,WAAWI,IAAIA,EAAAA,CAAAA;EAC3D;EAEA,MAAMmB,UAAUT,WAAmBC,SAAiBC,YAAqC;AACvF,UAAMT,OAAO,MAAM,KAAKd,GACrBe,OAAO;MAAEgB,KAAKA,IAAIxB,WAAWqB,KAAK;IAAE,CAAA,EACpCZ,KAAKT,UAAAA,EACLU,MACCQ,IACEP,GAAGX,WAAWc,WAAWA,SAAAA,GACzBH,GAAGX,WAAWe,SAASA,OAAAA,GACvBJ,GAAGX,WAAWgB,YAAYA,UAAAA,CAAAA,CAAAA;AAGhC,UAAMS,MAAMlB,KAAK,CAAA,GAAIiB;AACrB,WAAOC,OAAO,OAAO,IAAIC,OAAOD,GAAAA,IAAO;EACzC;AACF;","names":["integer","sqliteTable","text","mediaTable","id","primaryKey","ownerType","notNull","ownerId","collection","name","fileName","mimeType","size","disk","path","order","customProperties","mode","conversions","createdAt","updatedAt","and","asc","eq","max","sql","createMediaTable","db","run","sql","DrizzleMediaStore","save","record","insert","mediaTable","values","onConflictDoUpdate","target","id","set","find","rows","select","from","where","eq","limit","listByOwner","ownerType","ownerId","collection","undefined","and","orderBy","asc","order","delete","nextOrder","max","top","Number"]}
1
+ {"version":3,"sources":["../src/media.schema.ts","../src/drizzle-media-store.ts","../src/attachment.column.ts"],"sourcesContent":["import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core';\n\n/**\n * Drizzle (sqlite) media table. `order` maps to the `position` column. JSON columns\n * use text(mode:'json'). Postgres/MySQL variants follow the same shape via their\n * respective drizzle cores.\n */\nexport const mediaTable = sqliteTable('media', {\n id: text('id').primaryKey(),\n ownerType: text('owner_type').notNull(),\n ownerId: text('owner_id').notNull(),\n collection: text('collection').notNull(),\n name: text('name').notNull(),\n fileName: text('file_name').notNull(),\n mimeType: text('mime_type').notNull(),\n size: integer('size').notNull(),\n disk: text('disk').notNull(),\n path: text('path').notNull(),\n order: integer('position').notNull(),\n customProperties: text('custom_properties', { mode: 'json' }).notNull(),\n conversions: text('conversions', { mode: 'json' }).notNull(),\n createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(),\n updatedAt: integer('updated_at', { mode: 'timestamp_ms' }).notNull(),\n});\n","import type { MediaRecord, MediaStore } from '@dudousxd/nestjs-media-core';\nimport { and, asc, eq, max, sql } from 'drizzle-orm';\nimport type { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';\nimport { mediaTable } from './media.schema';\n\ntype DB = BetterSQLite3Database<Record<string, never>>;\n\n/**\n * Migration-first (§3.10): Drizzle has no auto-ensure. Run migrations with\n * drizzle-kit in production; this helper creates the table for tests/dev.\n */\nexport function createMediaTable(db: DB): void {\n db.run(sql`\n CREATE TABLE IF NOT EXISTS media (\n id text PRIMARY KEY NOT NULL,\n owner_type text NOT NULL,\n owner_id text NOT NULL,\n collection text NOT NULL,\n name text NOT NULL,\n file_name text NOT NULL,\n mime_type text NOT NULL,\n size integer NOT NULL,\n disk text NOT NULL,\n path text NOT NULL,\n position integer NOT NULL,\n custom_properties text NOT NULL,\n conversions text NOT NULL,\n created_at integer NOT NULL,\n updated_at integer NOT NULL\n )\n `);\n}\n\n/** MediaStore backed by Drizzle (better-sqlite3). POJO receiving the drizzle db. */\nexport class DrizzleMediaStore implements MediaStore {\n constructor(private readonly db: DB) {}\n\n async save(record: MediaRecord): Promise<MediaRecord> {\n await this.db\n .insert(mediaTable)\n .values(record)\n .onConflictDoUpdate({ target: mediaTable.id, set: record });\n return record;\n }\n\n async find(id: string): Promise<MediaRecord | null> {\n const rows = await this.db.select().from(mediaTable).where(eq(mediaTable.id, id)).limit(1);\n return (rows[0] as MediaRecord | undefined) ?? null;\n }\n\n async listByOwner(\n ownerType: string,\n ownerId: string,\n collection?: string,\n ): Promise<MediaRecord[]> {\n const where =\n collection === undefined\n ? and(eq(mediaTable.ownerType, ownerType), eq(mediaTable.ownerId, ownerId))\n : and(\n eq(mediaTable.ownerType, ownerType),\n eq(mediaTable.ownerId, ownerId),\n eq(mediaTable.collection, collection),\n );\n const rows = await this.db\n .select()\n .from(mediaTable)\n .where(where)\n .orderBy(asc(mediaTable.order));\n return rows as MediaRecord[];\n }\n\n async delete(id: string): Promise<void> {\n await this.db.delete(mediaTable).where(eq(mediaTable.id, id));\n }\n\n async nextOrder(ownerType: string, ownerId: string, collection: string): Promise<number> {\n const rows = await this.db\n .select({ max: max(mediaTable.order) })\n .from(mediaTable)\n .where(\n and(\n eq(mediaTable.ownerType, ownerType),\n eq(mediaTable.ownerId, ownerId),\n eq(mediaTable.collection, collection),\n ),\n );\n const top = rows[0]?.max;\n return top == null ? 0 : Number(top) + 1;\n }\n}\n","import { Attachment, type AttachmentData } from '@dudousxd/nestjs-media-core';\nimport { customType } from 'drizzle-orm/sqlite-core';\n\n/**\n * Drizzle (sqlite) custom column for an Attachment value:\n * `avatar: attachment('avatar')` → stored as JSON text, rehydrated to an `Attachment`.\n */\nexport const attachment = customType<{ data: Attachment | null; driverData: string }>({\n dataType() {\n return 'text';\n },\n toDriver(value: Attachment | null): string {\n return JSON.stringify(value ? value.toJSON() : null);\n },\n fromDriver(value: string): Attachment | null {\n return Attachment.fromJSON(value ? (JSON.parse(value) as AttachmentData) : null);\n },\n});\n"],"mappings":";;;;AAAA,SAASA,SAASC,aAAaC,YAAY;AAOpC,IAAMC,aAAaF,YAAY,SAAS;EAC7CG,IAAIF,KAAK,IAAA,EAAMG,WAAU;EACzBC,WAAWJ,KAAK,YAAA,EAAcK,QAAO;EACrCC,SAASN,KAAK,UAAA,EAAYK,QAAO;EACjCE,YAAYP,KAAK,YAAA,EAAcK,QAAO;EACtCG,MAAMR,KAAK,MAAA,EAAQK,QAAO;EAC1BI,UAAUT,KAAK,WAAA,EAAaK,QAAO;EACnCK,UAAUV,KAAK,WAAA,EAAaK,QAAO;EACnCM,MAAMb,QAAQ,MAAA,EAAQO,QAAO;EAC7BO,MAAMZ,KAAK,MAAA,EAAQK,QAAO;EAC1BQ,MAAMb,KAAK,MAAA,EAAQK,QAAO;EAC1BS,OAAOhB,QAAQ,UAAA,EAAYO,QAAO;EAClCU,kBAAkBf,KAAK,qBAAqB;IAAEgB,MAAM;EAAO,CAAA,EAAGX,QAAO;EACrEY,aAAajB,KAAK,eAAe;IAAEgB,MAAM;EAAO,CAAA,EAAGX,QAAO;EAC1Da,WAAWpB,QAAQ,cAAc;IAAEkB,MAAM;EAAe,CAAA,EAAGX,QAAO;EAClEc,WAAWrB,QAAQ,cAAc;IAAEkB,MAAM;EAAe,CAAA,EAAGX,QAAO;AACpE,CAAA;;;ACtBA,SAASe,KAAKC,KAAKC,IAAIC,KAAKC,WAAW;AAUhC,SAASC,iBAAiBC,IAAM;AACrCA,KAAGC,IAAIC;;;;;;;;;;;;;;;;;;GAkBN;AACH;AApBgBH;AAuBT,IAAMI,oBAAN,MAAMA;EAjCb,OAiCaA;;;;EACX,YAA6BH,IAAQ;SAARA,KAAAA;EAAS;EAE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AMS,MAAMlB,KAAK,CAAA,GAAIiB;AACrB,WAAOC,OAAO,OAAO,IAAIC,OAAOD,GAAAA,IAAO;EACzC;AACF;;;ACzFA,SAASE,kBAAuC;AAChD,SAASC,kBAAkB;AAMpB,IAAMC,aAAaD,WAA4D;EACpFE,WAAAA;AACE,WAAO;EACT;EACAC,SAASC,OAAwB;AAC/B,WAAOC,KAAKC,UAAUF,QAAQA,MAAMG,OAAM,IAAK,IAAA;EACjD;EACAC,WAAWJ,OAAa;AACtB,WAAOL,WAAWU,SAASL,QAASC,KAAKK,MAAMN,KAAAA,IAA4B,IAAA;EAC7E;AACF,CAAA;","names":["integer","sqliteTable","text","mediaTable","id","primaryKey","ownerType","notNull","ownerId","collection","name","fileName","mimeType","size","disk","path","order","customProperties","mode","conversions","createdAt","updatedAt","and","asc","eq","max","sql","createMediaTable","db","run","sql","DrizzleMediaStore","save","record","insert","mediaTable","values","onConflictDoUpdate","target","id","set","find","rows","select","from","where","eq","limit","listByOwner","ownerType","ownerId","collection","undefined","and","orderBy","asc","order","delete","nextOrder","max","top","Number","Attachment","customType","attachment","dataType","toDriver","value","JSON","stringify","toJSON","fromDriver","fromJSON","parse"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dudousxd/nestjs-media-database-drizzle",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "nestjs-media Drizzle media store (sqlite)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -24,15 +24,15 @@
24
24
  ],
25
25
  "peerDependencies": {
26
26
  "drizzle-orm": "^0.38.0",
27
- "@dudousxd/nestjs-media-core": "0.1.0"
27
+ "@dudousxd/nestjs-media-core": "0.3.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "better-sqlite3": "11.8.1",
31
31
  "drizzle-orm": "0.38.4",
32
32
  "tsup": "8.3.5",
33
33
  "typescript": "5.9.3",
34
- "@dudousxd/nestjs-media-core": "0.1.0",
35
- "@dudousxd/nestjs-media-testing": "0.1.0"
34
+ "@dudousxd/nestjs-media-core": "0.3.0",
35
+ "@dudousxd/nestjs-media-testing": "0.3.0"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "tsup",