Slide 8
Slide 8 text
7
KDDI Agile Development Center Corporation
Drizzle x Aurora DSQLで困ったこと
① Migration(drizzle migrate)を実行できない
自動生成されるテーブルにserialを使われている
対応されるかも? [FEATURE]: Allow for non sequential primary key for id of migrationsTable
② 一部使えないAPIがある
findFirst関数で別テーブルのデータを取得しようとすると Data type json not supported
select "todoTable"."id", "todoTable"."title",
"todoTable"."category_id", "todoTable_category"."data" as
"category" from "todo" "todoTable" left join lateral (select
json_build_array("todoTable_category"."id",
"todoTable_category"."name") as "data" from (select * from
"category" "todoTable_category" where
"todoTable_category"."id" = "todoTable"."category_id" limit $1)
"todoTable_category") "todoTable_category" on true limit $2
const todoFindFirstWithCategory
= await client.query.todoTable.findFirst({
with: {
category: true,
},
});
実際に発行されるSQL
実装
CREATE TABLE IF NOT EXISTS "drizzle"."__drizzle_migrations" ( "id" serial PRIMARY KEY, "hash" text NOT NULL, "created_at" bigint );