zitejs 0.9.28 → 0.9.29

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.
@@ -64,10 +64,23 @@ function generateSchema(base) {
64
64
  function generateDbTs(base, schema, integrationId = 'databases') {
65
65
  const lines = [];
66
66
  lines.push('// Auto-generated by zitejs sync. Do not edit manually.');
67
- lines.push('// Table methods: .findAll(opts?) → { records: T[], total, hasMore }');
68
- lines.push('// .findOne(id) → T | .create(data) → T | .update(id, data) → T');
69
- lines.push('// .delete(id) → { deleted: true } | .bulkCreate(records) → T[]');
70
- lines.push('// Raw SQL: zite.sql({ query: "SELECT..." }) → { rows: Record<string, unknown>[] }');
67
+ lines.push('//');
68
+ lines.push('// Usage in endpoint files (src/api/*.ts):');
69
+ lines.push('// import { zite } from "zitejs/db";');
70
+ lines.push('//');
71
+ lines.push('// Always use "zitejs/db" — never use relative paths like "../../.zite/db".');
72
+ lines.push('// The tsconfig aliases resolve zitejs/* imports to the correct .zite/ files.');
73
+ lines.push('//');
74
+ lines.push('// Table client methods:');
75
+ lines.push('// .findAll(opts?) → { records: T[], total: number, hasMore: boolean }');
76
+ lines.push('// .findOne(id) → T');
77
+ lines.push('// .create(data) → T');
78
+ lines.push('// .update(id, data) → T');
79
+ lines.push('// .delete(id) → { deleted: true }');
80
+ lines.push('// .bulkCreate(records) → T[]');
81
+ lines.push('//');
82
+ lines.push('// Raw SQL:');
83
+ lines.push('// zite.sql({ query: "SELECT..." }) → { rows: Record<string, unknown>[] }');
71
84
  lines.push("import { createTableClient, createSqlClient } from 'zitejs/runtime';");
72
85
  lines.push('');
73
86
  for (const table of base.tables ?? []) {
@@ -53,10 +53,23 @@ export function generateSchema(base) {
53
53
  export function generateDbTs(base, schema, integrationId = 'databases') {
54
54
  const lines = [];
55
55
  lines.push('// Auto-generated by zitejs sync. Do not edit manually.');
56
- lines.push('// Table methods: .findAll(opts?) → { records: T[], total, hasMore }');
57
- lines.push('// .findOne(id) → T | .create(data) → T | .update(id, data) → T');
58
- lines.push('// .delete(id) → { deleted: true } | .bulkCreate(records) → T[]');
59
- lines.push('// Raw SQL: zite.sql({ query: "SELECT..." }) → { rows: Record<string, unknown>[] }');
56
+ lines.push('//');
57
+ lines.push('// Usage in endpoint files (src/api/*.ts):');
58
+ lines.push('// import { zite } from "zitejs/db";');
59
+ lines.push('//');
60
+ lines.push('// Always use "zitejs/db" — never use relative paths like "../../.zite/db".');
61
+ lines.push('// The tsconfig aliases resolve zitejs/* imports to the correct .zite/ files.');
62
+ lines.push('//');
63
+ lines.push('// Table client methods:');
64
+ lines.push('// .findAll(opts?) → { records: T[], total: number, hasMore: boolean }');
65
+ lines.push('// .findOne(id) → T');
66
+ lines.push('// .create(data) → T');
67
+ lines.push('// .update(id, data) → T');
68
+ lines.push('// .delete(id) → { deleted: true }');
69
+ lines.push('// .bulkCreate(records) → T[]');
70
+ lines.push('//');
71
+ lines.push('// Raw SQL:');
72
+ lines.push('// zite.sql({ query: "SELECT..." }) → { rows: Record<string, unknown>[] }');
60
73
  lines.push("import { createTableClient, createSqlClient } from 'zitejs/runtime';");
61
74
  lines.push('');
62
75
  for (const table of base.tables ?? []) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zitejs",
3
- "version": "0.9.28",
3
+ "version": "0.9.29",
4
4
  "description": "The Zite framework — build apps on Zite Database",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/runtime/index.js",