Skip to content

Commit aedfd57

Browse files
committed
final changes
1 parent 7e9cc7e commit aedfd57

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kirimase",
3-
"version": "0.0.51",
3+
"version": "0.0.52",
44
"description": "A Rails-like CLI for building full-stack Next.js apps faster",
55
"main": "index.js",
66
"type": "module",

src/commands/generate/generators/model/queries/generators.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ const generateDrizzleGetByIdQuery = (schema: Schema, relations: DBField[]) => {
193193
.join("")
194194
: ""
195195
};
196+
if (row === undefined) return {};
196197
const ${tableNameFirstChar} = ${
197198
relations.length > 0
198199
? ` { ...row.${tableNameSingular}, ${relations
@@ -257,6 +258,7 @@ const generateDrizzleGetByIdWithChildrenQuery = (
257258
.join("")
258259
: ""
259260
};
261+
if (rows.length === 0) return {};
260262
const ${tableNameFirstChar} = rows[0].${tableNameSingular};
261263
${
262264
children.length > 0

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { buildSchema } from "./commands/generate/index.js";
66
import { addPackage } from "./commands/add/index.js";
77

88
const program = new Command();
9-
program.name("kirimase").description("Kirimase CLI").version("0.0.51");
9+
program.name("kirimase").description("Kirimase CLI").version("0.0.52");
1010

1111
addCommonOptions(program.command("init"))
1212
.description("initialise and configure kirimase within directory")

0 commit comments

Comments
 (0)