@helloleo/plugins 0.2.14 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/templates/tanstack-start-2026-07-30/drizzle/meta/_journal.json +1 -13
- package/dist/templates/tanstack-start-2026-07-30/src/db/schema.ts +19 -17
- package/dist/templates/tanstack-start-2026-07-30/src/routes/api/health.ts +5 -3
- package/package.json +1 -1
- package/src/templates/tanstack-start-2026-07-30/drizzle/meta/_journal.json +1 -13
- package/src/templates/tanstack-start-2026-07-30/src/db/schema.ts +19 -17
- package/src/templates/tanstack-start-2026-07-30/src/routes/api/health.ts +5 -3
- package/dist/templates/tanstack-start-2026-07-30/drizzle/0000_tidy_kang.sql +0 -5
- package/dist/templates/tanstack-start-2026-07-30/drizzle/meta/0000_snapshot.json +0 -50
- package/src/templates/tanstack-start-2026-07-30/drizzle/0000_tidy_kang.sql +0 -5
- package/src/templates/tanstack-start-2026-07-30/drizzle/meta/0000_snapshot.json +0 -50
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// push`) and prod D1 (migrations via `wrangler d1 migrations apply`).
|
|
1
|
+
// Single source of truth for the database schema. Define tables here — the
|
|
2
|
+
// SQL migration files under drizzle/ are generated and applied automatically
|
|
3
|
+
// (dev on server start, production on publish). Never hand-write SQL or touch
|
|
4
|
+
// drizzle/. Prefer ADDING columns/tables over renaming or deleting existing
|
|
5
|
+
// ones: renames cannot be migrated automatically.
|
|
7
6
|
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
// Example:
|
|
8
|
+
//
|
|
9
|
+
// import { sql } from 'drizzle-orm'
|
|
10
|
+
// import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core'
|
|
11
|
+
//
|
|
12
|
+
// export const notes = sqliteTable('notes', {
|
|
13
|
+
// id: integer('id').primaryKey({ autoIncrement: true }),
|
|
14
|
+
// title: text('title').notNull(),
|
|
15
|
+
// createdAt: integer('created_at')
|
|
16
|
+
// .notNull()
|
|
17
|
+
// .default(sql`(unixepoch())`),
|
|
18
|
+
// })
|
|
19
|
+
//
|
|
20
|
+
// export type Note = typeof notes.$inferSelect
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createFileRoute } from '@tanstack/react-router'
|
|
2
|
+
import { sql } from 'drizzle-orm'
|
|
2
3
|
import { db } from '#/db'
|
|
3
|
-
import { entries } from '#/db/schema'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Server route example: GET /api/health. Use this file as the base for
|
|
@@ -39,7 +39,9 @@ export const Route = createFileRoute('/api/health')({
|
|
|
39
39
|
runtime: 'cloudflare-workers',
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
// Database health:
|
|
42
|
+
// Database health: schema-agnostic connectivity ping. Deliberately
|
|
43
|
+
// NOT a query against an app table — the health probe must keep
|
|
44
|
+
// working no matter how src/db/schema.ts evolves.
|
|
43
45
|
let database: {
|
|
44
46
|
status: 'ok' | 'error'
|
|
45
47
|
latencyMs: number
|
|
@@ -47,7 +49,7 @@ export const Route = createFileRoute('/api/health')({
|
|
|
47
49
|
}
|
|
48
50
|
const dbStart = Date.now()
|
|
49
51
|
try {
|
|
50
|
-
await db.
|
|
52
|
+
await db.run(sql`SELECT 1`)
|
|
51
53
|
database = {
|
|
52
54
|
status: 'ok',
|
|
53
55
|
latencyMs: Date.now() - dbStart,
|
package/package.json
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// push`) and prod D1 (migrations via `wrangler d1 migrations apply`).
|
|
1
|
+
// Single source of truth for the database schema. Define tables here — the
|
|
2
|
+
// SQL migration files under drizzle/ are generated and applied automatically
|
|
3
|
+
// (dev on server start, production on publish). Never hand-write SQL or touch
|
|
4
|
+
// drizzle/. Prefer ADDING columns/tables over renaming or deleting existing
|
|
5
|
+
// ones: renames cannot be migrated automatically.
|
|
7
6
|
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
// Example:
|
|
8
|
+
//
|
|
9
|
+
// import { sql } from 'drizzle-orm'
|
|
10
|
+
// import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core'
|
|
11
|
+
//
|
|
12
|
+
// export const notes = sqliteTable('notes', {
|
|
13
|
+
// id: integer('id').primaryKey({ autoIncrement: true }),
|
|
14
|
+
// title: text('title').notNull(),
|
|
15
|
+
// createdAt: integer('created_at')
|
|
16
|
+
// .notNull()
|
|
17
|
+
// .default(sql`(unixepoch())`),
|
|
18
|
+
// })
|
|
19
|
+
//
|
|
20
|
+
// export type Note = typeof notes.$inferSelect
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createFileRoute } from '@tanstack/react-router'
|
|
2
|
+
import { sql } from 'drizzle-orm'
|
|
2
3
|
import { db } from '#/db'
|
|
3
|
-
import { entries } from '#/db/schema'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Server route example: GET /api/health. Use this file as the base for
|
|
@@ -39,7 +39,9 @@ export const Route = createFileRoute('/api/health')({
|
|
|
39
39
|
runtime: 'cloudflare-workers',
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
// Database health:
|
|
42
|
+
// Database health: schema-agnostic connectivity ping. Deliberately
|
|
43
|
+
// NOT a query against an app table — the health probe must keep
|
|
44
|
+
// working no matter how src/db/schema.ts evolves.
|
|
43
45
|
let database: {
|
|
44
46
|
status: 'ok' | 'error'
|
|
45
47
|
latencyMs: number
|
|
@@ -47,7 +49,7 @@ export const Route = createFileRoute('/api/health')({
|
|
|
47
49
|
}
|
|
48
50
|
const dbStart = Date.now()
|
|
49
51
|
try {
|
|
50
|
-
await db.
|
|
52
|
+
await db.run(sql`SELECT 1`)
|
|
51
53
|
database = {
|
|
52
54
|
status: 'ok',
|
|
53
55
|
latencyMs: Date.now() - dbStart,
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "6",
|
|
3
|
-
"dialect": "sqlite",
|
|
4
|
-
"id": "ec5ce3c5-da3c-496c-942e-72a9a9579093",
|
|
5
|
-
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
6
|
-
"tables": {
|
|
7
|
-
"entries": {
|
|
8
|
-
"name": "entries",
|
|
9
|
-
"columns": {
|
|
10
|
-
"id": {
|
|
11
|
-
"name": "id",
|
|
12
|
-
"type": "integer",
|
|
13
|
-
"primaryKey": true,
|
|
14
|
-
"notNull": true,
|
|
15
|
-
"autoincrement": true
|
|
16
|
-
},
|
|
17
|
-
"label": {
|
|
18
|
-
"name": "label",
|
|
19
|
-
"type": "text",
|
|
20
|
-
"primaryKey": false,
|
|
21
|
-
"notNull": true,
|
|
22
|
-
"autoincrement": false
|
|
23
|
-
},
|
|
24
|
-
"created_at": {
|
|
25
|
-
"name": "created_at",
|
|
26
|
-
"type": "integer",
|
|
27
|
-
"primaryKey": false,
|
|
28
|
-
"notNull": true,
|
|
29
|
-
"autoincrement": false,
|
|
30
|
-
"default": "(unixepoch())"
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"indexes": {},
|
|
34
|
-
"foreignKeys": {},
|
|
35
|
-
"compositePrimaryKeys": {},
|
|
36
|
-
"uniqueConstraints": {},
|
|
37
|
-
"checkConstraints": {}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"views": {},
|
|
41
|
-
"enums": {},
|
|
42
|
-
"_meta": {
|
|
43
|
-
"schemas": {},
|
|
44
|
-
"tables": {},
|
|
45
|
-
"columns": {}
|
|
46
|
-
},
|
|
47
|
-
"internal": {
|
|
48
|
-
"indexes": {}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "6",
|
|
3
|
-
"dialect": "sqlite",
|
|
4
|
-
"id": "ec5ce3c5-da3c-496c-942e-72a9a9579093",
|
|
5
|
-
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
6
|
-
"tables": {
|
|
7
|
-
"entries": {
|
|
8
|
-
"name": "entries",
|
|
9
|
-
"columns": {
|
|
10
|
-
"id": {
|
|
11
|
-
"name": "id",
|
|
12
|
-
"type": "integer",
|
|
13
|
-
"primaryKey": true,
|
|
14
|
-
"notNull": true,
|
|
15
|
-
"autoincrement": true
|
|
16
|
-
},
|
|
17
|
-
"label": {
|
|
18
|
-
"name": "label",
|
|
19
|
-
"type": "text",
|
|
20
|
-
"primaryKey": false,
|
|
21
|
-
"notNull": true,
|
|
22
|
-
"autoincrement": false
|
|
23
|
-
},
|
|
24
|
-
"created_at": {
|
|
25
|
-
"name": "created_at",
|
|
26
|
-
"type": "integer",
|
|
27
|
-
"primaryKey": false,
|
|
28
|
-
"notNull": true,
|
|
29
|
-
"autoincrement": false,
|
|
30
|
-
"default": "(unixepoch())"
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"indexes": {},
|
|
34
|
-
"foreignKeys": {},
|
|
35
|
-
"compositePrimaryKeys": {},
|
|
36
|
-
"uniqueConstraints": {},
|
|
37
|
-
"checkConstraints": {}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"views": {},
|
|
41
|
-
"enums": {},
|
|
42
|
-
"_meta": {
|
|
43
|
-
"schemas": {},
|
|
44
|
-
"tables": {},
|
|
45
|
-
"columns": {}
|
|
46
|
-
},
|
|
47
|
-
"internal": {
|
|
48
|
-
"indexes": {}
|
|
49
|
-
}
|
|
50
|
-
}
|