@drizzle-adapter/d1 1.0.14 → 1.0.17
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/.wrangler/tmp/bundle-CHc9gh/checked-fetch.js +30 -0
- package/.wrangler/tmp/bundle-CHc9gh/middleware-insertion-facade.js +11 -0
- package/.wrangler/tmp/bundle-CHc9gh/middleware-loader.entry.ts +134 -0
- package/.wrangler/tmp/bundle-CHc9gh/strip-cf-connecting-ip-header.js +13 -0
- package/.wrangler/tmp/bundle-kh10f5/checked-fetch.js +30 -0
- package/.wrangler/tmp/bundle-kh10f5/middleware-insertion-facade.js +11 -0
- package/.wrangler/tmp/bundle-kh10f5/middleware-loader.entry.ts +134 -0
- package/.wrangler/tmp/bundle-kh10f5/strip-cf-connecting-ip-header.js +13 -0
- package/.wrangler/tmp/dev-BRrYv0/worker.js +6512 -0
- package/.wrangler/tmp/dev-BRrYv0/worker.js.map +8 -0
- package/.wrangler/tmp/dev-NlAyrN/worker.js +6512 -0
- package/.wrangler/tmp/dev-NlAyrN/worker.js.map +8 -0
- package/LICENSE +21 -674
- package/dist/Adapter/D1DrizzleAdapter.d.ts +14 -10
- package/dist/Adapter/D1DrizzleAdapter.js +16 -12
- package/dist/Adapter/D1DrizzleConnection.d.ts +6 -2
- package/dist/Adapter/D1DrizzleConnection.js +6 -2
- package/dist/Adapter/D1DrizzleDataTypes.d.ts +4 -0
- package/dist/Adapter/D1DrizzleDataTypes.js +4 -0
- package/dist/Adapter/D1DrizzleMigrator.d.ts +6 -2
- package/dist/Adapter/D1DrizzleMigrator.js +5 -1
- package/dist/Adapter/index.d.ts +2 -2
- package/dist/Adapter/index.js +2 -2
- package/dist/Factory/D1DrizzleAdapterFactory.d.ts +8 -4
- package/dist/Factory/D1DrizzleAdapterFactory.js +7 -3
- package/dist/Factory/D1DrizzleDataTypesFactory.d.ts +5 -1
- package/dist/Factory/D1DrizzleDataTypesFactory.js +5 -1
- package/dist/Factory/D1DrizzleMigratorFactory.d.ts +7 -3
- package/dist/Factory/D1DrizzleMigratorFactory.js +7 -3
- package/dist/Factory/index.d.ts +2 -2
- package/dist/Factory/index.js +2 -2
- package/dist/Interface/D1DrizzleClientInterface.d.ts +5 -1
- package/dist/Interface/index.d.ts +1 -1
- package/dist/Interface/index.js +1 -1
- package/dist/Type/Types.d.ts +4 -0
- package/dist/Type/index.d.ts +1 -1
- package/dist/Type/index.js +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/migrator.d.ts +3 -3
- package/dist/migrator.js +3 -3
- package/eslint.config.mjs +1 -1
- package/package.json +13 -11
- package/src/Adapter/D1DrizzleAdapter.ts +16 -11
- package/src/Adapter/D1DrizzleConnection.ts +7 -3
- package/src/Adapter/D1DrizzleDataTypes.ts +4 -0
- package/src/Adapter/D1DrizzleMigrator.ts +6 -1
- package/src/Factory/D1DrizzleAdapterFactory.ts +9 -4
- package/src/Factory/D1DrizzleDataTypesFactory.ts +5 -1
- package/src/Factory/D1DrizzleMigratorFactory.ts +7 -2
- package/src/Interface/D1DrizzleClientInterface.ts +5 -1
- package/src/Type/Types.ts +4 -0
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import type { TypeD1DatabaseConfig } from '../Type/Types';
|
|
2
|
-
import { D1DrizzleAdapter } from '../Adapter/D1DrizzleAdapter';
|
|
3
1
|
import type { DrizzleAdapterFactoryInterface } from '@drizzle-adapter/core';
|
|
4
2
|
|
|
3
|
+
import { D1DrizzleAdapter } from '../Adapter/D1DrizzleAdapter';
|
|
4
|
+
import type { TypeD1DatabaseConfig } from '../Type/Types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Factory for creating D1 adapter instances.
|
|
8
|
+
* Implements the DrizzleAdapterFactoryInterface for D1 database operations.
|
|
9
|
+
*/
|
|
5
10
|
export class D1DrizzleAdapterFactory implements DrizzleAdapterFactoryInterface
|
|
6
11
|
{
|
|
7
12
|
/**
|
|
8
13
|
* Returns a adapter.
|
|
9
14
|
*
|
|
10
|
-
* @param {TypeD1DatabaseConfig} databaseConfig
|
|
11
|
-
* @returns {D1DrizzleAdapter}
|
|
15
|
+
* @param {TypeD1DatabaseConfig} databaseConfig - The D1 database configuration
|
|
16
|
+
* @returns {D1DrizzleAdapter} A new D1 adapter instance
|
|
12
17
|
*/
|
|
13
18
|
public create(databaseConfig: TypeD1DatabaseConfig): D1DrizzleAdapter
|
|
14
19
|
{
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { DrizzleDataTypesFactoryInterface, TypeDrizzleDatabaseConfig } from '@drizzle-adapter/core';
|
|
2
2
|
import { SqliteCoreDrizzleDataTypes } from '@drizzle-adapter/sqlite-core';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Factory for creating D1 data types instances.
|
|
6
|
+
* Implements the DrizzleDataTypesFactoryInterface for D1 database operations.
|
|
7
|
+
*/
|
|
4
8
|
export class D1DrizzleDataTypesFactory implements DrizzleDataTypesFactoryInterface
|
|
5
9
|
{
|
|
6
10
|
/**
|
|
7
11
|
* Creates a new data types instance.
|
|
8
12
|
*
|
|
9
13
|
* @param {TypeDrizzleDatabaseConfig} _config - Not used in this implementation
|
|
10
|
-
* @returns {SqliteCoreDrizzleDataTypes}
|
|
14
|
+
* @returns {SqliteCoreDrizzleDataTypes} A new SQLite core data types instance
|
|
11
15
|
*/
|
|
12
16
|
public create(_config: TypeDrizzleDatabaseConfig): SqliteCoreDrizzleDataTypes
|
|
13
17
|
{
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import type { DrizzleMigratorFactoryInterface, TypeDrizzleMigratorConfig } from '@drizzle-adapter/core';
|
|
2
|
+
|
|
2
3
|
import { D1DrizzleMigrator } from '../migrator';
|
|
3
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Factory for creating D1 migrator instances.
|
|
7
|
+
* Implements the DrizzleMigratorFactoryInterface for D1 database migrations.
|
|
8
|
+
*/
|
|
4
9
|
export class D1DrizzleMigratorFactory implements DrizzleMigratorFactoryInterface
|
|
5
10
|
{
|
|
6
11
|
/**
|
|
7
12
|
* Returns a new migrator.
|
|
8
13
|
*
|
|
9
|
-
* @param {TypeDrizzleMigratorConfig} config
|
|
10
|
-
* @returns {D1DrizzleMigrator}
|
|
14
|
+
* @param {TypeDrizzleMigratorConfig} config - The migrator configuration
|
|
15
|
+
* @returns {D1DrizzleMigrator} A new D1 migrator instance
|
|
11
16
|
*/
|
|
12
17
|
public create(config: TypeDrizzleMigratorConfig): D1DrizzleMigrator
|
|
13
18
|
{
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type { AnyD1Database } from 'drizzle-orm/d1';
|
|
2
1
|
import type { DrizzleClientInterface } from '@drizzle-adapter/core';
|
|
2
|
+
import type { AnyD1Database } from 'drizzle-orm/d1';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Interface for D1 Drizzle client operations.
|
|
6
|
+
* Extends the core DrizzleClientInterface with D1-specific database operations.
|
|
7
|
+
*/
|
|
4
8
|
export interface D1DrizzleClientInterface extends DrizzleClientInterface
|
|
5
9
|
{
|
|
6
10
|
execute(...args: any[]): ReturnType<AnyD1Database['run']>;
|
package/src/Type/Types.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { D1Database } from '@cloudflare/workers-types';
|
|
2
2
|
import type { TypeDrizzleDatabaseConfig } from '@drizzle-adapter/core';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Configuration interface for D1 database connections.
|
|
6
|
+
* Extends the core database configuration with D1-specific settings.
|
|
7
|
+
*/
|
|
4
8
|
export interface TypeD1DatabaseConfig extends TypeDrizzleDatabaseConfig
|
|
5
9
|
{
|
|
6
10
|
readonly DATABASE: D1Database;
|