@bunnykit/orm 0.1.9 → 0.1.10

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/README.md CHANGED
@@ -1219,7 +1219,12 @@ export interface UsersAttributes {
1219
1219
  }
1220
1220
 
1221
1221
  declare module "../User" {
1222
- interface User extends UsersAttributes {}
1222
+ interface User {
1223
+ id: number;
1224
+ name: string;
1225
+ email: string | null;
1226
+ created_at: string;
1227
+ }
1223
1228
  }
1224
1229
  ```
1225
1230
 
@@ -36,7 +36,12 @@ export class TypeGenerator {
36
36
  const modelDeclaration = this.getModelDeclaration(table, className, target.modelImportPrefix);
37
37
  if (declarationOnly && modelDeclaration) {
38
38
  lines.push(`declare module "${modelDeclaration.path}" {`);
39
- lines.push(` interface ${modelDeclaration.className} extends ${interfaceName} {}`);
39
+ lines.push(` interface ${modelDeclaration.className} {`);
40
+ for (const col of columns) {
41
+ const tsType = TypeMapper.sqlToTsType(col.type, col.nullable);
42
+ lines.push(` ${col.name}${col.nullable ? "?" : ""}: ${tsType};`);
43
+ }
44
+ lines.push(" }");
40
45
  lines.push("}");
41
46
  lines.push("");
42
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnykit/orm",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "An Eloquent-inspired ORM for Bun's native SQL client supporting SQLite, MySQL, and PostgreSQL.",
5
5
  "license": "MIT",
6
6
  "packageManager": "bun@1.3.12",