minor v1.4.0 #89
1 changed files with 6 additions and 1 deletions
|
@ -3,7 +3,7 @@ export interface DynamicQueryStructure {
|
|||
select: string[] | "*";
|
||||
table: string;
|
||||
where?: Array<ConditionStructure>;
|
||||
join?: Array<DynamicQueryStructure & { foreignColumn: string }>;
|
||||
join?: Array<DynamicQueryStructure & JoinStructure>;
|
||||
orderBy?: Array<OrderByStructure>; // only at top level
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,8 @@ export type WhereOperation =
|
|||
| "timespanEq"; // Date before x years (YYYY-01-01 <bis> YYYY-12-31)
|
||||
// TODO: age between | age equals | age greater | age smaller
|
||||
|
||||
export type JoinStructure = { foreignColumn: string; type: "defined" } | { condition: string; type: "custom" };
|
||||
|
||||
export type OrderByStructure = {
|
||||
id: string;
|
||||
depth: number;
|
||||
|
@ -101,18 +103,21 @@ export const exampleQuery: DynamicQueryStructure = {
|
|||
select: "*",
|
||||
table: "communication",
|
||||
foreignColumn: "sendNewsletter",
|
||||
type: "defined",
|
||||
},
|
||||
{
|
||||
id: "91011",
|
||||
select: "*",
|
||||
table: "membership",
|
||||
foreignColumn: "memberships",
|
||||
type: "defined",
|
||||
join: [
|
||||
{
|
||||
id: "121314",
|
||||
select: "*",
|
||||
table: "membership_status",
|
||||
foreignColumn: "status",
|
||||
type: "defined",
|
||||
where: [
|
||||
{
|
||||
structureType: "condition",
|
||||
|
|
Loading…
Add table
Reference in a new issue