12 lines
1.3 KiB
JavaScript
12 lines
1.3 KiB
JavaScript
|
import { $ } from "bun";
|
||
|
|
||
|
await $`bun run ../transpile.js -S schema.json -j out/ -c out/ -s out/`;
|
||
|
await $`rm -rf out/test.db`;
|
||
|
await $`sqlite3 out/test.db < out/types.sql`;
|
||
|
const vid1 = await $`echo 'INSERT INTO Vector3 (x, y, z) VALUES (-9.0, 9.0, 4.0) RETURNING id;' | sqlite3 out/test.db`.text();
|
||
|
const vid2 = await $`echo 'INSERT INTO Vector3 (x, y, z) VALUES (9.0, 9.0, 0.0) RETURNING id;' | sqlite3 out/test.db`.text();
|
||
|
const vid3 = await $`echo 'INSERT INTO Vector3 (x, y, z) VALUES (0.0, 1.0, 0.0) RETURNING id;' | sqlite3 out/test.db`.text();
|
||
|
const cid = await $`echo 'INSERT INTO Camera3D (position_id, target_id, up_id, fovy, projection) VALUES (${vid1}, ${vid2}, ${vid3}, 60.0, 0) RETURNING id;' | sqlite3 out/test.db`.text();
|
||
|
const eid = await $`echo "INSERT INTO Entity (Name, camera_id, Strength, Endurance, Intelligence, Wisdom, Charisma, Faith, Artisan, Metalworking, Alchemy, Engineering, Culinary, Ranged, Melee, Acrobatics, Prestidigitation, Language, Medicine, Thaumatology, Theology, Fishing, Mining, Survival, Gardening, History, Perception, Luck, Stealth, Attractiveness, Affluence, Notoriety) VALUES ('Zongor',${cid},1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,42,1,1,1,1) RETURNING id;" | sqlite3 out/test.db`.text();
|
||
|
console.log(`generated Entity=${eid} Camera3D=${cid} Vector3=${vid1} Vector3=${vid2} Vector3=${vid3}`);
|