Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions examples/aws-lambda-rds-aurora-drizzle/alchemy.run.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as Alchemy from "alchemy";
import * as AWS from "alchemy/AWS";
import * as Drizzle from "alchemy/Drizzle";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import Api from "./src/Api.ts";

export default Alchemy.Stack(
"AwsLambdaRdsAuroraDrizzleExample",
{
providers: Layer.mergeAll(AWS.providers(), Drizzle.providers()),
state: Alchemy.localState(),
},
Effect.gen(function* () {
const api = yield* Api;
return {
url: api.functionUrl,
};
}),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CREATE TABLE "posts" (
"id" serial PRIMARY KEY,
"user_id" integer NOT NULL,
"title" text NOT NULL,
"body" text NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL
);

--> statement-breakpoint
CREATE TABLE "users" (
"id" serial PRIMARY KEY,
"email" text NOT NULL UNIQUE,
"name" text NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL
);

--> statement-breakpoint
ALTER TABLE "posts" ADD CONSTRAINT "posts_user_id_users_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
{
"dialect": "postgres",
"id": "a5dd7b5d-0c42-408d-97a5-9c0345a6825a",
"prevIds": ["00000000-0000-0000-0000-000000000000"],
"version": "8",
"ddl": [
{
"isRlsEnabled": false,
"name": "posts",
"entityType": "tables",
"schema": "public"
},
{
"isRlsEnabled": false,
"name": "users",
"entityType": "tables",
"schema": "public"
},
{
"type": "serial",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "id",
"entityType": "columns",
"schema": "public",
"table": "posts"
},
{
"type": "integer",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "user_id",
"entityType": "columns",
"schema": "public",
"table": "posts"
},
{
"type": "text",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "title",
"entityType": "columns",
"schema": "public",
"table": "posts"
},
{
"type": "text",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "body",
"entityType": "columns",
"schema": "public",
"table": "posts"
},
{
"type": "timestamp with time zone",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": "now()",
"generated": null,
"identity": null,
"name": "created_at",
"entityType": "columns",
"schema": "public",
"table": "posts"
},
{
"type": "serial",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "id",
"entityType": "columns",
"schema": "public",
"table": "users"
},
{
"type": "text",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "email",
"entityType": "columns",
"schema": "public",
"table": "users"
},
{
"type": "text",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "name",
"entityType": "columns",
"schema": "public",
"table": "users"
},
{
"type": "timestamp with time zone",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": "now()",
"generated": null,
"identity": null,
"name": "created_at",
"entityType": "columns",
"schema": "public",
"table": "users"
},
{
"nameExplicit": false,
"columns": ["user_id"],
"schemaTo": "public",
"tableTo": "users",
"columnsTo": ["id"],
"onUpdate": "NO ACTION",
"onDelete": "CASCADE",
"name": "posts_user_id_users_id_fkey",
"entityType": "fks",
"schema": "public",
"table": "posts"
},
{
"columns": ["id"],
"nameExplicit": false,
"name": "posts_pkey",
"schema": "public",
"table": "posts",
"entityType": "pks"
},
{
"columns": ["id"],
"nameExplicit": false,
"name": "users_pkey",
"schema": "public",
"table": "users",
"entityType": "pks"
},
{
"nameExplicit": false,
"columns": ["email"],
"nullsNotDistinct": false,
"name": "users_email_key",
"schema": "public",
"table": "users",
"entityType": "uniques"
}
],
"renames": []
}
29 changes: 29 additions & 0 deletions examples/aws-lambda-rds-aurora-drizzle/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "aws-lambda-rds-aurora-drizzle",
"version": "0.0.0",
"private": true,
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/alchemy-run/alchemy-effect.git",
"directory": "examples/aws-lambda-rds-aurora-drizzle"
},
"type": "module",
"scripts": {
"deploy": "alchemy deploy",
"dev": "alchemy dev",
"destroy": "alchemy destroy",
"test": "bun test"
},
"dependencies": {
"@aws-sdk/client-rds-data": "^3.0.0",
"@distilled.cloud/aws": "catalog:",
"@effect/platform-node": "catalog:",
"alchemy": "workspace:*",
"drizzle-orm": "1.0.0-rc.1",
"effect": "catalog:"
},
"devDependencies": {
"drizzle-kit": "1.0.0-rc.1"
}
}
Loading
Loading