Skip to content

Commit 53c9ab3

Browse files
committed
feat: require explicit DATABASE_POOL_URL and remove API Extractor
1 parent cc14371 commit 53c9ab3

File tree

4 files changed

+15
-23
lines changed

4 files changed

+15
-23
lines changed

.changeset/fresh-penguins-pull.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@systemfsoftware/neon-serverless-adapter": minor
3+
---
4+
5+
feat: require explicit DATABASE_POOL_URL configuration
6+
feat: remove API Extractor dependency

packages/neon-serverless-adapter/api-extractor.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/neon-serverless-adapter/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
"scripts": {
3333
"prepare": "pnpm turbo build",
3434
"clean": "rimraf dist .tshy .tshy-build",
35-
"build": "pnpm run clean && tshy && pnpm run extract",
36-
"extract": "api-extractor run"
35+
"build": "pnpm run clean && tshy"
3736
},
3837
"dependencies": {
3938
"@neondatabase/serverless": "^0.9.5"

packages/neon-serverless-adapter/src/mod.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@ import * as Socket from '@effect/platform/Socket'
22
import * as neon from '@neondatabase/serverless'
33
import type { DrizzleConfig } from 'drizzle-orm'
44
import { drizzle, type NeonDatabase } from 'drizzle-orm/neon-serverless'
5-
import { Config as C, Effect, pipe } from 'effect'
6-
import type { ConfigError } from 'effect/ConfigError'
5+
import { Config as C, Context, Effect } from 'effect'
76

8-
/**
9-
* @public
10-
*/
117
export namespace Adapter {
128
export type TSchema = Record<string, unknown>
139

@@ -21,8 +17,8 @@ export namespace Adapter {
2117
pool: Pool
2218
db: DB<T>
2319
},
24-
ConfigError,
25-
Socket.WebSocketConstructor
20+
never,
21+
Socket.WebSocketConstructor | AdapterConfig
2622
>
2723

2824
export type Config = Readonly<{
@@ -37,7 +33,8 @@ export function Adapter<T extends Adapter.TSchema = Record<string, never>>(
3733
options?: Adapter.Options<T>,
3834
): Adapter.Adapter<T> {
3935
return Effect.gen(function*() {
40-
const connectionString = yield* Config.DATABASE_URL
36+
const config = yield* AdapterConfig
37+
const connectionString = config.DATABASE_POOL_URL
4138
const webSocketConstructor = yield* Socket.WebSocketConstructor
4239

4340
yield* Effect.sync(() => {
@@ -55,12 +52,6 @@ export function Adapter<T extends Adapter.TSchema = Record<string, never>>(
5552
})
5653
}
5754

58-
/**
59-
* @public
60-
*/
61-
export const Config: Adapter.Config = Object.freeze({
62-
DATABASE_URL: pipe(
63-
C.nonEmptyString('DATABASE_URL'),
64-
C.withDescription('Neon database connection string'),
65-
),
66-
})
55+
export class AdapterConfig extends Context.Tag('AdapterConfig')<AdapterConfig, {
56+
readonly DATABASE_POOL_URL: string
57+
}>() {}

0 commit comments

Comments
 (0)