Skip to content

Commit

Permalink
Use a specific type
Browse files Browse the repository at this point in the history
Refs #2122
  • Loading branch information
thewilkybarkid committed Dec 20, 2024
1 parent 756e956 commit d379a0e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FetchHttpClient } from '@effect/platform'
import { NodeHttpServer, NodeRuntime } from '@effect/platform-node'
import { LibsqlClient } from '@effect/sql-libsql'
import { Config, Effect, Function, Layer, Logger, LogLevel } from 'effect'
import { Config, Effect, Function, Layer, Logger, LogLevel, Schema } from 'effect'
import { pipe } from 'fp-ts/lib/function.js'
import { createServer } from 'http'
import fetch from 'make-fetch-happen'
Expand Down Expand Up @@ -35,7 +35,10 @@ pipe(
Effect.provide(
Layer.mergeAll(
LibsqlClient.layerConfig({
url: Config.string('LIBSQL_URL'),
url: Schema.Config(
'LIBSQL_URL',
Schema.Union(Schema.TemplateLiteral('file:', Schema.String), Schema.Literal(':memory:'), Schema.URL),
),
authToken: Config.withDefault(Config.redacted('LIBSQL_AUTH_TOKEN'), undefined),
}),
Layer.effectDiscard(Effect.logDebug('Database connected')),
Expand Down

0 comments on commit d379a0e

Please sign in to comment.