import { Parse } from "./Parser" ; import { Print } from "./Printer" ; import { Query } from "./Query" ; const simpsons = { people : [ { id : 1 , firstName : "Bart" , lastName : "Simpson" , isChild : true } , { id : 2 , firstName : "Lisa" , lastName : "Simpson" , isChild : true } , { id : 3 , firstName : "Maggie" , lastName : "Simpson" , isChild : true } , { id : 4 , firstName : "Marge" , lastName : "Simpson" , isChild : false } , { id : 5 , firstName : "Homer" , lastName : "Simpson" , isChild : false } , { id : 6 , firstName : "Montgomery" , lastName : "Burns" , isChild : false } , { id : 7 , firstName : "Whelan" , lastName : "Smithers" , isChild : false } , { id : 8 , firstName : "Nillhouse" , lastName : "Van Houten" , isChild : true } , { id : 9 , firstName : "Nelson" , lastName : "Muntz" , isChild : true } , { id : 10 , firstName : "Principal" , lastName : "Skinner" , isChild : false } , ] , places : [ { name : "Springfield Elementary" , ownerId : 10 , isActive : true } , { name : "Nuclear Power Plant" , ownerId : 6 , isActive : true } , { name : "Evergreen Terrace" , ownerId : 4 , isActive : true } , { name : "Monorail" , ownerId : 8 , isActive : false } , { name : "Treehouse of Horror" , ownerId : 1 , isActive : true } , { name : "Playground" , ownerId : 9 , isActive : true } , ] , } as const ; export type DBv1 = typeof simpsons ; export type EX1 = Query < "SELECT firstName AS name FROM people WHERE lastName = 'Simpson'" , DBv1 > ; export type EX2 = Query < "SELECT firstName, lastName FROM people WHERE isChild = true" , DBv1 > ; export type EX3 = Query < "SELECT * FROM people WHERE isChild = false AND firstName LIKE 'M%'" , DBv1 > ; export type DBv2 = Query < "UPDATE people SET firstName = 'Milhouse' WHERE id = 8" , DBv1 > ; export type EX4 = Query < "SELECT * FROM people WHERE id = 8" , DBv2 > ; export type DBv3 = Query < "INSERT INTO people SET id = 11, firstName = 'Troy', lastName = 'McClure', isChild = false" , DBv2 > ; export type EX5 = Query < "SELECT * FROM people WHERE firstName = 'Troy'" , DBv3 > ; export type DBv4 = Query < "DELETE FROM people WHERE firstName = 'Troy' AND lastName = 'McClure'" , DBv3 > ; export type EX6 = Query < "SELECT firstName FROM people WHERE isChild = false" , DBv4 > ; export type DBv5 = Query < "INSERT INTO people SET id = 11, firstName = 'Moe', lastName = 'Szyslak', isChild = false" , DBv4 > ; export type EX7 = Query < "SELECT id, firstName AS name FROM people WHERE isChild = false AND firstName LIKE 'M%'" , DBv5 > ; export type DBv6 = Query < 'INSERT INTO places SET name = "Moe\'s Tavern", ownerId = 11, isActive = true' , DBv5 > ; export type EX9 = Query < "SELECT name, person.firstName, person.lastName FROM places INNER JOIN people AS person ON places.ownerId = person.id" , DBv1 > ; export type PrinterEX0 = Print < Parse < 'SELECT name,r.name AS roleName FROM users AS u INNER JOIN roles r ON u.roleId = r.id WHERE name = "Bob" AND awesome = true LIMIT 2 OFFSET 3' > > ;