GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refactor(relay): acquire unlink services from context · pingdotgg/t3code@7800b33

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • infra/relay/src
    • db.ts
    • http
      • Api.test.ts
      • Api.ts
    • worker.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎infra/relay/src/db.ts‎

Copy file name to clipboardExpand all lines: infra/relay/src/db.ts
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as RemovalPolicy from "alchemy/RemovalPolicy";
77
import type { EffectPgDatabase } from "drizzle-orm/effect-postgres";
88
import * as Context from "effect/Context";
99
import * as Effect from "effect/Effect";
10+
import * as Layer from "effect/Layer";
1011

1112
import { relayDatabaseMode } from "./dbConfig.ts";
1213

@@ -17,6 +18,23 @@ export class RelayDb extends Context.Service<
1718
}
1819
>()("t3code-relay/db/RelayDb") {}
1920

21+
export class RelayTransactions extends Context.Service<
22+
RelayTransactions,
23+
{
24+
readonly withTransaction: RelayDb["Service"]["$client"]["withTransaction"];
25+
}
26+
>()("t3code-relay/db/RelayTransactions") {
27+
static readonly layer = Layer.effect(
28+
RelayTransactions,
29+
Effect.gen(function* () {
30+
const db = yield* RelayDb;
31+
return RelayTransactions.of({
32+
withTransaction: db.$client.withTransaction,
33+
});
34+
}),
35+
);
36+
}
37+
2038
export const PlanetscaleDatabase = Effect.gen(function* () {
2139
const { stage } = yield* Alchemy.Stack;
2240
const schema = yield* Drizzle.Schema("RelaySchema", {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.