|
| 1 | +/** Types generated for queries found in "src/Benchmarks/EntityTraversal/EntityTraversal.sql" */ |
| 2 | +import { PreparedQuery } from '@pgtyped/runtime' |
| 3 | + |
| 4 | +/** 'GetCatColorById' parameters type */ |
| 5 | +export interface IGetCatColorByIdParams { |
| 6 | + catId?: number | null | void |
| 7 | +} |
| 8 | + |
| 9 | +/** 'GetCatColorById' return type */ |
| 10 | +export interface IGetCatColorByIdResult { |
| 11 | + hex_code: string |
| 12 | +} |
| 13 | + |
| 14 | +/** 'GetCatColorById' query type */ |
| 15 | +export interface IGetCatColorByIdQuery { |
| 16 | + params: IGetCatColorByIdParams |
| 17 | + result: IGetCatColorByIdResult |
| 18 | +} |
| 19 | + |
| 20 | +const getCatColorByIdIR: any = { |
| 21 | + usedParamSet: { catId: true }, |
| 22 | + params: [ |
| 23 | + { |
| 24 | + name: 'catId', |
| 25 | + required: false, |
| 26 | + transform: { type: 'scalar' }, |
| 27 | + locs: [{ a: 154, b: 159 }], |
| 28 | + }, |
| 29 | + ], |
| 30 | + statement: |
| 31 | + 'SELECT\n hex_code\nFROM\n cat\n JOIN cat_color ON cat_color.id = cat.cat_color_id\n JOIN color_hex ON color_hex.id = cat_color.id\nWHERE\n cat.id = :catId', |
| 32 | +} |
| 33 | + |
| 34 | +/** |
| 35 | + * Query generated from SQL: |
| 36 | + * ``` |
| 37 | + * SELECT |
| 38 | + * hex_code |
| 39 | + * FROM |
| 40 | + * cat |
| 41 | + * JOIN cat_color ON cat_color.id = cat.cat_color_id |
| 42 | + * JOIN color_hex ON color_hex.id = cat_color.id |
| 43 | + * WHERE |
| 44 | + * cat.id = :catId |
| 45 | + * ``` |
| 46 | + */ |
| 47 | +export const getCatColorById = new PreparedQuery< |
| 48 | + IGetCatColorByIdParams, |
| 49 | + IGetCatColorByIdResult |
| 50 | +>(getCatColorByIdIR) |
| 51 | + |
| 52 | +/** 'CountCatsByColor' parameters type */ |
| 53 | +export interface ICountCatsByColorParams { |
| 54 | + hexCode?: string | null | void |
| 55 | +} |
| 56 | + |
| 57 | +/** 'CountCatsByColor' return type */ |
| 58 | +export interface ICountCatsByColorResult { |
| 59 | + count: string | null |
| 60 | +} |
| 61 | + |
| 62 | +/** 'CountCatsByColor' query type */ |
| 63 | +export interface ICountCatsByColorQuery { |
| 64 | + params: ICountCatsByColorParams |
| 65 | + result: ICountCatsByColorResult |
| 66 | +} |
| 67 | + |
| 68 | +const countCatsByColorIR: any = { |
| 69 | + usedParamSet: { hexCode: true }, |
| 70 | + params: [ |
| 71 | + { |
| 72 | + name: 'hexCode', |
| 73 | + required: false, |
| 74 | + transform: { type: 'scalar' }, |
| 75 | + locs: [{ a: 166, b: 173 }], |
| 76 | + }, |
| 77 | + ], |
| 78 | + statement: |
| 79 | + 'SELECT\n COUNT(*)\nFROM\n cat\n JOIN cat_color ON cat_color.id = cat.cat_color_id\n JOIN color_hex ON color_hex.id = cat_color.id\nWHERE\n color_hex.hex_code = :hexCode', |
| 80 | +} |
| 81 | + |
| 82 | +/** |
| 83 | + * Query generated from SQL: |
| 84 | + * ``` |
| 85 | + * SELECT |
| 86 | + * COUNT(*) |
| 87 | + * FROM |
| 88 | + * cat |
| 89 | + * JOIN cat_color ON cat_color.id = cat.cat_color_id |
| 90 | + * JOIN color_hex ON color_hex.id = cat_color.id |
| 91 | + * WHERE |
| 92 | + * color_hex.hex_code = :hexCode |
| 93 | + * ``` |
| 94 | + */ |
| 95 | +export const countCatsByColor = new PreparedQuery< |
| 96 | + ICountCatsByColorParams, |
| 97 | + ICountCatsByColorResult |
| 98 | +>(countCatsByColorIR) |
| 99 | + |
| 100 | +/** 'GetToysAvailableToCat' parameters type */ |
| 101 | +export interface IGetToysAvailableToCatParams { |
| 102 | + catId?: number | null | void |
| 103 | +} |
| 104 | + |
| 105 | +/** 'GetToysAvailableToCat' return type */ |
| 106 | +export interface IGetToysAvailableToCatResult { |
| 107 | + toy_name: string |
| 108 | +} |
| 109 | + |
| 110 | +/** 'GetToysAvailableToCat' query type */ |
| 111 | +export interface IGetToysAvailableToCatQuery { |
| 112 | + params: IGetToysAvailableToCatParams |
| 113 | + result: IGetToysAvailableToCatResult |
| 114 | +} |
| 115 | + |
| 116 | +const getToysAvailableToCatIR: any = { |
| 117 | + usedParamSet: { catId: true }, |
| 118 | + params: [ |
| 119 | + { |
| 120 | + name: 'catId', |
| 121 | + required: false, |
| 122 | + transform: { type: 'scalar' }, |
| 123 | + locs: [{ a: 202, b: 207 }], |
| 124 | + }, |
| 125 | + ], |
| 126 | + statement: |
| 127 | + 'SELECT\n toy.toy_name\nFROM\n toy\n JOIN toy_house ON toy_house.toy_id = toy.id\n JOIN house ON house.id = toy_house.house_id\n JOIN house_cat ON house_cat.house_id = house.id\nWHERE\n house_cat.cat_id = :catId', |
| 128 | +} |
| 129 | + |
| 130 | +/** |
| 131 | + * Query generated from SQL: |
| 132 | + * ``` |
| 133 | + * SELECT |
| 134 | + * toy.toy_name |
| 135 | + * FROM |
| 136 | + * toy |
| 137 | + * JOIN toy_house ON toy_house.toy_id = toy.id |
| 138 | + * JOIN house ON house.id = toy_house.house_id |
| 139 | + * JOIN house_cat ON house_cat.house_id = house.id |
| 140 | + * WHERE |
| 141 | + * house_cat.cat_id = :catId |
| 142 | + * ``` |
| 143 | + */ |
| 144 | +export const getToysAvailableToCat = new PreparedQuery< |
| 145 | + IGetToysAvailableToCatParams, |
| 146 | + IGetToysAvailableToCatResult |
| 147 | +>(getToysAvailableToCatIR) |
0 commit comments