1use serde::{Deserialize, Serialize};
34use std::fmt;
35#[cfg(feature = "bindings")]
36use ts_rs::TS;
37
38fn default_true() -> bool {
40 true
41}
42
43fn is_true(v: &bool) -> bool {
44 *v
45}
46
47#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
76#[cfg_attr(feature = "bindings", derive(TS))]
77#[serde(rename_all = "snake_case")]
78#[cfg_attr(feature = "bindings", ts(export))]
79pub enum Expression {
80 Literal(Literal),
82 Boolean(BooleanLiteral),
83 Null(Null),
84
85 Identifier(Identifier),
87 Column(Column),
88 Table(TableRef),
89 Star(Star),
90 BracedWildcard(Box<Expression>),
92
93 Select(Box<Select>),
95 Union(Box<Union>),
96 Intersect(Box<Intersect>),
97 Except(Box<Except>),
98 Subquery(Box<Subquery>),
99 PipeOperator(Box<PipeOperator>),
100 Pivot(Box<Pivot>),
101 PivotAlias(Box<PivotAlias>),
102 Unpivot(Box<Unpivot>),
103 Values(Box<Values>),
104 PreWhere(Box<PreWhere>),
105 Stream(Box<Stream>),
106 UsingData(Box<UsingData>),
107 XmlNamespace(Box<XmlNamespace>),
108
109 Insert(Box<Insert>),
111 Update(Box<Update>),
112 Delete(Box<Delete>),
113 Copy(Box<CopyStmt>),
114 Put(Box<PutStmt>),
115 StageReference(Box<StageReference>),
116
117 Alias(Box<Alias>),
119 Cast(Box<Cast>),
120 Collation(Box<CollationExpr>),
121 Case(Box<Case>),
122
123 And(Box<BinaryOp>),
125 Or(Box<BinaryOp>),
126 Add(Box<BinaryOp>),
127 Sub(Box<BinaryOp>),
128 Mul(Box<BinaryOp>),
129 Div(Box<BinaryOp>),
130 Mod(Box<BinaryOp>),
131 Eq(Box<BinaryOp>),
132 Neq(Box<BinaryOp>),
133 Lt(Box<BinaryOp>),
134 Lte(Box<BinaryOp>),
135 Gt(Box<BinaryOp>),
136 Gte(Box<BinaryOp>),
137 Like(Box<LikeOp>),
138 ILike(Box<LikeOp>),
139 Match(Box<BinaryOp>),
141 BitwiseAnd(Box<BinaryOp>),
142 BitwiseOr(Box<BinaryOp>),
143 BitwiseXor(Box<BinaryOp>),
144 Concat(Box<BinaryOp>),
145 Adjacent(Box<BinaryOp>), TsMatch(Box<BinaryOp>), PropertyEQ(Box<BinaryOp>), ArrayContainsAll(Box<BinaryOp>), ArrayContainedBy(Box<BinaryOp>), ArrayOverlaps(Box<BinaryOp>), JSONBContainsAllTopKeys(Box<BinaryOp>), JSONBContainsAnyTopKeys(Box<BinaryOp>), JSONBDeleteAtPath(Box<BinaryOp>), ExtendsLeft(Box<BinaryOp>), ExtendsRight(Box<BinaryOp>), Not(Box<UnaryOp>),
161 Neg(Box<UnaryOp>),
162 BitwiseNot(Box<UnaryOp>),
163
164 In(Box<In>),
166 Between(Box<Between>),
167 IsNull(Box<IsNull>),
168 IsTrue(Box<IsTrueFalse>),
169 IsFalse(Box<IsTrueFalse>),
170 IsJson(Box<IsJson>),
171 Is(Box<BinaryOp>), Exists(Box<Exists>),
173 MemberOf(Box<BinaryOp>),
175
176 Function(Box<Function>),
178 AggregateFunction(Box<AggregateFunction>),
179 WindowFunction(Box<WindowFunction>),
180
181 From(Box<From>),
183 Join(Box<Join>),
184 JoinedTable(Box<JoinedTable>),
185 Where(Box<Where>),
186 GroupBy(Box<GroupBy>),
187 Having(Box<Having>),
188 OrderBy(Box<OrderBy>),
189 Limit(Box<Limit>),
190 Offset(Box<Offset>),
191 Qualify(Box<Qualify>),
192 With(Box<With>),
193 Cte(Box<Cte>),
194 DistributeBy(Box<DistributeBy>),
195 ClusterBy(Box<ClusterBy>),
196 SortBy(Box<SortBy>),
197 LateralView(Box<LateralView>),
198 Hint(Box<Hint>),
199 Pseudocolumn(Pseudocolumn),
200
201 Connect(Box<Connect>),
203 Prior(Box<Prior>),
204 ConnectByRoot(Box<ConnectByRoot>),
205
206 MatchRecognize(Box<MatchRecognize>),
208
209 Ordered(Box<Ordered>),
211
212 Window(Box<WindowSpec>),
214 Over(Box<Over>),
215 WithinGroup(Box<WithinGroup>),
216
217 DataType(DataType),
219
220 Array(Box<Array>),
222 Struct(Box<Struct>),
223 Tuple(Box<Tuple>),
224
225 Interval(Box<Interval>),
227
228 ConcatWs(Box<ConcatWs>),
230 Substring(Box<SubstringFunc>),
231 Upper(Box<UnaryFunc>),
232 Lower(Box<UnaryFunc>),
233 Length(Box<UnaryFunc>),
234 Trim(Box<TrimFunc>),
235 LTrim(Box<UnaryFunc>),
236 RTrim(Box<UnaryFunc>),
237 Replace(Box<ReplaceFunc>),
238 Reverse(Box<UnaryFunc>),
239 Left(Box<LeftRightFunc>),
240 Right(Box<LeftRightFunc>),
241 Repeat(Box<RepeatFunc>),
242 Lpad(Box<PadFunc>),
243 Rpad(Box<PadFunc>),
244 Split(Box<SplitFunc>),
245 RegexpLike(Box<RegexpFunc>),
246 RegexpReplace(Box<RegexpReplaceFunc>),
247 RegexpExtract(Box<RegexpExtractFunc>),
248 Overlay(Box<OverlayFunc>),
249
250 Abs(Box<UnaryFunc>),
252 Round(Box<RoundFunc>),
253 Floor(Box<FloorFunc>),
254 Ceil(Box<CeilFunc>),
255 Power(Box<BinaryFunc>),
256 Sqrt(Box<UnaryFunc>),
257 Cbrt(Box<UnaryFunc>),
258 Ln(Box<UnaryFunc>),
259 Log(Box<LogFunc>),
260 Exp(Box<UnaryFunc>),
261 Sign(Box<UnaryFunc>),
262 Greatest(Box<VarArgFunc>),
263 Least(Box<VarArgFunc>),
264
265 CurrentDate(CurrentDate),
267 CurrentTime(CurrentTime),
268 CurrentTimestamp(CurrentTimestamp),
269 CurrentTimestampLTZ(CurrentTimestampLTZ),
270 AtTimeZone(Box<AtTimeZone>),
271 DateAdd(Box<DateAddFunc>),
272 DateSub(Box<DateAddFunc>),
273 DateDiff(Box<DateDiffFunc>),
274 DateTrunc(Box<DateTruncFunc>),
275 Extract(Box<ExtractFunc>),
276 ToDate(Box<ToDateFunc>),
277 ToTimestamp(Box<ToTimestampFunc>),
278 Date(Box<UnaryFunc>),
279 Time(Box<UnaryFunc>),
280 DateFromUnixDate(Box<UnaryFunc>),
281 UnixDate(Box<UnaryFunc>),
282 UnixSeconds(Box<UnaryFunc>),
283 UnixMillis(Box<UnaryFunc>),
284 UnixMicros(Box<UnaryFunc>),
285 UnixToTimeStr(Box<BinaryFunc>),
286 TimeStrToDate(Box<UnaryFunc>),
287 DateToDi(Box<UnaryFunc>),
288 DiToDate(Box<UnaryFunc>),
289 TsOrDiToDi(Box<UnaryFunc>),
290 TsOrDsToDatetime(Box<UnaryFunc>),
291 TsOrDsToTimestamp(Box<UnaryFunc>),
292 YearOfWeek(Box<UnaryFunc>),
293 YearOfWeekIso(Box<UnaryFunc>),
294
295 Coalesce(Box<VarArgFunc>),
297 NullIf(Box<BinaryFunc>),
298 IfFunc(Box<IfFunc>),
299 IfNull(Box<BinaryFunc>),
300 Nvl(Box<BinaryFunc>),
301 Nvl2(Box<Nvl2Func>),
302
303 TryCast(Box<Cast>),
305 SafeCast(Box<Cast>),
306
307 Count(Box<CountFunc>),
309 Sum(Box<AggFunc>),
310 Avg(Box<AggFunc>),
311 Min(Box<AggFunc>),
312 Max(Box<AggFunc>),
313 GroupConcat(Box<GroupConcatFunc>),
314 StringAgg(Box<StringAggFunc>),
315 ListAgg(Box<ListAggFunc>),
316 ArrayAgg(Box<AggFunc>),
317 CountIf(Box<AggFunc>),
318 SumIf(Box<SumIfFunc>),
319 Stddev(Box<AggFunc>),
320 StddevPop(Box<AggFunc>),
321 StddevSamp(Box<AggFunc>),
322 Variance(Box<AggFunc>),
323 VarPop(Box<AggFunc>),
324 VarSamp(Box<AggFunc>),
325 Median(Box<AggFunc>),
326 Mode(Box<AggFunc>),
327 First(Box<AggFunc>),
328 Last(Box<AggFunc>),
329 AnyValue(Box<AggFunc>),
330 ApproxDistinct(Box<AggFunc>),
331 ApproxCountDistinct(Box<AggFunc>),
332 ApproxPercentile(Box<ApproxPercentileFunc>),
333 Percentile(Box<PercentileFunc>),
334 LogicalAnd(Box<AggFunc>),
335 LogicalOr(Box<AggFunc>),
336 Skewness(Box<AggFunc>),
337 BitwiseCount(Box<UnaryFunc>),
338 ArrayConcatAgg(Box<AggFunc>),
339 ArrayUniqueAgg(Box<AggFunc>),
340 BoolXorAgg(Box<AggFunc>),
341
342 RowNumber(RowNumber),
344 Rank(Rank),
345 DenseRank(DenseRank),
346 NTile(Box<NTileFunc>),
347 Lead(Box<LeadLagFunc>),
348 Lag(Box<LeadLagFunc>),
349 FirstValue(Box<ValueFunc>),
350 LastValue(Box<ValueFunc>),
351 NthValue(Box<NthValueFunc>),
352 PercentRank(PercentRank),
353 CumeDist(CumeDist),
354 PercentileCont(Box<PercentileFunc>),
355 PercentileDisc(Box<PercentileFunc>),
356
357 Contains(Box<BinaryFunc>),
359 StartsWith(Box<BinaryFunc>),
360 EndsWith(Box<BinaryFunc>),
361 Position(Box<PositionFunc>),
362 Initcap(Box<UnaryFunc>),
363 Ascii(Box<UnaryFunc>),
364 Chr(Box<UnaryFunc>),
365 CharFunc(Box<CharFunc>),
367 Soundex(Box<UnaryFunc>),
368 Levenshtein(Box<BinaryFunc>),
369 ByteLength(Box<UnaryFunc>),
370 Hex(Box<UnaryFunc>),
371 LowerHex(Box<UnaryFunc>),
372 Unicode(Box<UnaryFunc>),
373
374 ModFunc(Box<BinaryFunc>),
376 Random(Random),
377 Rand(Box<Rand>),
378 TruncFunc(Box<TruncateFunc>),
379 Pi(Pi),
380 Radians(Box<UnaryFunc>),
381 Degrees(Box<UnaryFunc>),
382 Sin(Box<UnaryFunc>),
383 Cos(Box<UnaryFunc>),
384 Tan(Box<UnaryFunc>),
385 Asin(Box<UnaryFunc>),
386 Acos(Box<UnaryFunc>),
387 Atan(Box<UnaryFunc>),
388 Atan2(Box<BinaryFunc>),
389 IsNan(Box<UnaryFunc>),
390 IsInf(Box<UnaryFunc>),
391 IntDiv(Box<BinaryFunc>),
392
393 Decode(Box<DecodeFunc>),
395
396 DateFormat(Box<DateFormatFunc>),
398 FormatDate(Box<DateFormatFunc>),
399 Year(Box<UnaryFunc>),
400 Month(Box<UnaryFunc>),
401 Day(Box<UnaryFunc>),
402 Hour(Box<UnaryFunc>),
403 Minute(Box<UnaryFunc>),
404 Second(Box<UnaryFunc>),
405 DayOfWeek(Box<UnaryFunc>),
406 DayOfWeekIso(Box<UnaryFunc>),
407 DayOfMonth(Box<UnaryFunc>),
408 DayOfYear(Box<UnaryFunc>),
409 WeekOfYear(Box<UnaryFunc>),
410 Quarter(Box<UnaryFunc>),
411 AddMonths(Box<BinaryFunc>),
412 MonthsBetween(Box<BinaryFunc>),
413 LastDay(Box<LastDayFunc>),
414 NextDay(Box<BinaryFunc>),
415 Epoch(Box<UnaryFunc>),
416 EpochMs(Box<UnaryFunc>),
417 FromUnixtime(Box<FromUnixtimeFunc>),
418 UnixTimestamp(Box<UnixTimestampFunc>),
419 MakeDate(Box<MakeDateFunc>),
420 MakeTimestamp(Box<MakeTimestampFunc>),
421 TimestampTrunc(Box<DateTruncFunc>),
422 TimeStrToUnix(Box<UnaryFunc>),
423
424 SessionUser(SessionUser),
426
427 SHA(Box<UnaryFunc>),
429 SHA1Digest(Box<UnaryFunc>),
430
431 TimeToUnix(Box<UnaryFunc>),
433
434 ArrayFunc(Box<ArrayConstructor>),
436 ArrayLength(Box<UnaryFunc>),
437 ArraySize(Box<UnaryFunc>),
438 Cardinality(Box<UnaryFunc>),
439 ArrayContains(Box<BinaryFunc>),
440 ArrayPosition(Box<BinaryFunc>),
441 ArrayAppend(Box<BinaryFunc>),
442 ArrayPrepend(Box<BinaryFunc>),
443 ArrayConcat(Box<VarArgFunc>),
444 ArraySort(Box<ArraySortFunc>),
445 ArrayReverse(Box<UnaryFunc>),
446 ArrayDistinct(Box<UnaryFunc>),
447 ArrayJoin(Box<ArrayJoinFunc>),
448 ArrayToString(Box<ArrayJoinFunc>),
449 Unnest(Box<UnnestFunc>),
450 Explode(Box<UnaryFunc>),
451 ExplodeOuter(Box<UnaryFunc>),
452 ArrayFilter(Box<ArrayFilterFunc>),
453 ArrayTransform(Box<ArrayTransformFunc>),
454 ArrayFlatten(Box<UnaryFunc>),
455 ArrayCompact(Box<UnaryFunc>),
456 ArrayIntersect(Box<VarArgFunc>),
457 ArrayUnion(Box<BinaryFunc>),
458 ArrayExcept(Box<BinaryFunc>),
459 ArrayRemove(Box<BinaryFunc>),
460 ArrayZip(Box<VarArgFunc>),
461 Sequence(Box<SequenceFunc>),
462 Generate(Box<SequenceFunc>),
463 ExplodingGenerateSeries(Box<SequenceFunc>),
464 ToArray(Box<UnaryFunc>),
465 StarMap(Box<BinaryFunc>),
466
467 StructFunc(Box<StructConstructor>),
469 StructExtract(Box<StructExtractFunc>),
470 NamedStruct(Box<NamedStructFunc>),
471
472 MapFunc(Box<MapConstructor>),
474 MapFromEntries(Box<UnaryFunc>),
475 MapFromArrays(Box<BinaryFunc>),
476 MapKeys(Box<UnaryFunc>),
477 MapValues(Box<UnaryFunc>),
478 MapContainsKey(Box<BinaryFunc>),
479 MapConcat(Box<VarArgFunc>),
480 ElementAt(Box<BinaryFunc>),
481 TransformKeys(Box<TransformFunc>),
482 TransformValues(Box<TransformFunc>),
483
484 JsonExtract(Box<JsonExtractFunc>),
486 JsonExtractScalar(Box<JsonExtractFunc>),
487 JsonExtractPath(Box<JsonPathFunc>),
488 JsonArray(Box<VarArgFunc>),
489 JsonObject(Box<JsonObjectFunc>),
490 JsonQuery(Box<JsonExtractFunc>),
491 JsonValue(Box<JsonExtractFunc>),
492 JsonArrayLength(Box<UnaryFunc>),
493 JsonKeys(Box<UnaryFunc>),
494 JsonType(Box<UnaryFunc>),
495 ParseJson(Box<UnaryFunc>),
496 ToJson(Box<UnaryFunc>),
497 JsonSet(Box<JsonModifyFunc>),
498 JsonInsert(Box<JsonModifyFunc>),
499 JsonRemove(Box<JsonPathFunc>),
500 JsonMergePatch(Box<BinaryFunc>),
501 JsonArrayAgg(Box<JsonArrayAggFunc>),
502 JsonObjectAgg(Box<JsonObjectAggFunc>),
503
504 Convert(Box<ConvertFunc>),
506 Typeof(Box<UnaryFunc>),
507
508 Lambda(Box<LambdaExpr>),
510 Parameter(Box<Parameter>),
511 Placeholder(Placeholder),
512 NamedArgument(Box<NamedArgument>),
513 TableArgument(Box<TableArgument>),
516 SqlComment(Box<SqlComment>),
517
518 NullSafeEq(Box<BinaryOp>),
520 NullSafeNeq(Box<BinaryOp>),
521 Glob(Box<BinaryOp>),
522 SimilarTo(Box<SimilarToExpr>),
523 Any(Box<QuantifiedExpr>),
524 All(Box<QuantifiedExpr>),
525 Overlaps(Box<OverlapsExpr>),
526
527 BitwiseLeftShift(Box<BinaryOp>),
529 BitwiseRightShift(Box<BinaryOp>),
530 BitwiseAndAgg(Box<AggFunc>),
531 BitwiseOrAgg(Box<AggFunc>),
532 BitwiseXorAgg(Box<AggFunc>),
533
534 Subscript(Box<Subscript>),
536 Dot(Box<DotAccess>),
537 MethodCall(Box<MethodCall>),
538 ArraySlice(Box<ArraySlice>),
539
540 CreateTable(Box<CreateTable>),
542 DropTable(Box<DropTable>),
543 AlterTable(Box<AlterTable>),
544 CreateIndex(Box<CreateIndex>),
545 DropIndex(Box<DropIndex>),
546 CreateView(Box<CreateView>),
547 DropView(Box<DropView>),
548 AlterView(Box<AlterView>),
549 AlterIndex(Box<AlterIndex>),
550 Truncate(Box<Truncate>),
551 Use(Box<Use>),
552 Cache(Box<Cache>),
553 Uncache(Box<Uncache>),
554 LoadData(Box<LoadData>),
555 Pragma(Box<Pragma>),
556 Grant(Box<Grant>),
557 Revoke(Box<Revoke>),
558 Comment(Box<Comment>),
559 SetStatement(Box<SetStatement>),
560 CreateSchema(Box<CreateSchema>),
562 DropSchema(Box<DropSchema>),
563 DropNamespace(Box<DropNamespace>),
564 CreateDatabase(Box<CreateDatabase>),
565 DropDatabase(Box<DropDatabase>),
566 CreateFunction(Box<CreateFunction>),
567 DropFunction(Box<DropFunction>),
568 CreateProcedure(Box<CreateProcedure>),
569 DropProcedure(Box<DropProcedure>),
570 CreateSequence(Box<CreateSequence>),
571 DropSequence(Box<DropSequence>),
572 AlterSequence(Box<AlterSequence>),
573 CreateTrigger(Box<CreateTrigger>),
574 DropTrigger(Box<DropTrigger>),
575 CreateType(Box<CreateType>),
576 DropType(Box<DropType>),
577 Describe(Box<Describe>),
578 Show(Box<Show>),
579
580 Command(Box<Command>),
582 Kill(Box<Kill>),
583 Execute(Box<ExecuteStatement>),
585
586 Raw(Raw),
588
589 Paren(Box<Paren>),
591
592 Annotated(Box<Annotated>),
594
595 Refresh(Box<Refresh>),
598 LockingStatement(Box<LockingStatement>),
599 SequenceProperties(Box<SequenceProperties>),
600 TruncateTable(Box<TruncateTable>),
601 Clone(Box<Clone>),
602 Attach(Box<Attach>),
603 Detach(Box<Detach>),
604 Install(Box<Install>),
605 Summarize(Box<Summarize>),
606 Declare(Box<Declare>),
607 DeclareItem(Box<DeclareItem>),
608 Set(Box<Set>),
609 Heredoc(Box<Heredoc>),
610 SetItem(Box<SetItem>),
611 QueryBand(Box<QueryBand>),
612 UserDefinedFunction(Box<UserDefinedFunction>),
613 RecursiveWithSearch(Box<RecursiveWithSearch>),
614 ProjectionDef(Box<ProjectionDef>),
615 TableAlias(Box<TableAlias>),
616 ByteString(Box<ByteString>),
617 HexStringExpr(Box<HexStringExpr>),
618 UnicodeString(Box<UnicodeString>),
619 ColumnPosition(Box<ColumnPosition>),
620 ColumnDef(Box<ColumnDef>),
621 AlterColumn(Box<AlterColumn>),
622 AlterSortKey(Box<AlterSortKey>),
623 AlterSet(Box<AlterSet>),
624 RenameColumn(Box<RenameColumn>),
625 Comprehension(Box<Comprehension>),
626 MergeTreeTTLAction(Box<MergeTreeTTLAction>),
627 MergeTreeTTL(Box<MergeTreeTTL>),
628 IndexConstraintOption(Box<IndexConstraintOption>),
629 ColumnConstraint(Box<ColumnConstraint>),
630 PeriodForSystemTimeConstraint(Box<PeriodForSystemTimeConstraint>),
631 CaseSpecificColumnConstraint(Box<CaseSpecificColumnConstraint>),
632 CharacterSetColumnConstraint(Box<CharacterSetColumnConstraint>),
633 CheckColumnConstraint(Box<CheckColumnConstraint>),
634 CompressColumnConstraint(Box<CompressColumnConstraint>),
635 DateFormatColumnConstraint(Box<DateFormatColumnConstraint>),
636 EphemeralColumnConstraint(Box<EphemeralColumnConstraint>),
637 WithOperator(Box<WithOperator>),
638 GeneratedAsIdentityColumnConstraint(Box<GeneratedAsIdentityColumnConstraint>),
639 AutoIncrementColumnConstraint(AutoIncrementColumnConstraint),
640 CommentColumnConstraint(CommentColumnConstraint),
641 GeneratedAsRowColumnConstraint(Box<GeneratedAsRowColumnConstraint>),
642 IndexColumnConstraint(Box<IndexColumnConstraint>),
643 MaskingPolicyColumnConstraint(Box<MaskingPolicyColumnConstraint>),
644 NotNullColumnConstraint(Box<NotNullColumnConstraint>),
645 PrimaryKeyColumnConstraint(Box<PrimaryKeyColumnConstraint>),
646 UniqueColumnConstraint(Box<UniqueColumnConstraint>),
647 WatermarkColumnConstraint(Box<WatermarkColumnConstraint>),
648 ComputedColumnConstraint(Box<ComputedColumnConstraint>),
649 InOutColumnConstraint(Box<InOutColumnConstraint>),
650 DefaultColumnConstraint(Box<DefaultColumnConstraint>),
651 PathColumnConstraint(Box<PathColumnConstraint>),
652 Constraint(Box<Constraint>),
653 Export(Box<Export>),
654 Filter(Box<Filter>),
655 Changes(Box<Changes>),
656 CopyParameter(Box<CopyParameter>),
657 Credentials(Box<Credentials>),
658 Directory(Box<Directory>),
659 ForeignKey(Box<ForeignKey>),
660 ColumnPrefix(Box<ColumnPrefix>),
661 PrimaryKey(Box<PrimaryKey>),
662 IntoClause(Box<IntoClause>),
663 JoinHint(Box<JoinHint>),
664 Opclass(Box<Opclass>),
665 Index(Box<Index>),
666 IndexParameters(Box<IndexParameters>),
667 ConditionalInsert(Box<ConditionalInsert>),
668 MultitableInserts(Box<MultitableInserts>),
669 OnConflict(Box<OnConflict>),
670 OnCondition(Box<OnCondition>),
671 Returning(Box<Returning>),
672 Introducer(Box<Introducer>),
673 PartitionRange(Box<PartitionRange>),
674 Fetch(Box<Fetch>),
675 Group(Box<Group>),
676 Cube(Box<Cube>),
677 Rollup(Box<Rollup>),
678 GroupingSets(Box<GroupingSets>),
679 LimitOptions(Box<LimitOptions>),
680 Lateral(Box<Lateral>),
681 TableFromRows(Box<TableFromRows>),
682 RowsFrom(Box<RowsFrom>),
683 MatchRecognizeMeasure(Box<MatchRecognizeMeasure>),
684 WithFill(Box<WithFill>),
685 Property(Box<Property>),
686 GrantPrivilege(Box<GrantPrivilege>),
687 GrantPrincipal(Box<GrantPrincipal>),
688 AllowedValuesProperty(Box<AllowedValuesProperty>),
689 AlgorithmProperty(Box<AlgorithmProperty>),
690 AutoIncrementProperty(Box<AutoIncrementProperty>),
691 AutoRefreshProperty(Box<AutoRefreshProperty>),
692 BackupProperty(Box<BackupProperty>),
693 BuildProperty(Box<BuildProperty>),
694 BlockCompressionProperty(Box<BlockCompressionProperty>),
695 CharacterSetProperty(Box<CharacterSetProperty>),
696 ChecksumProperty(Box<ChecksumProperty>),
697 CollateProperty(Box<CollateProperty>),
698 DataBlocksizeProperty(Box<DataBlocksizeProperty>),
699 DataDeletionProperty(Box<DataDeletionProperty>),
700 DefinerProperty(Box<DefinerProperty>),
701 DistKeyProperty(Box<DistKeyProperty>),
702 DistributedByProperty(Box<DistributedByProperty>),
703 DistStyleProperty(Box<DistStyleProperty>),
704 DuplicateKeyProperty(Box<DuplicateKeyProperty>),
705 EngineProperty(Box<EngineProperty>),
706 ToTableProperty(Box<ToTableProperty>),
707 ExecuteAsProperty(Box<ExecuteAsProperty>),
708 ExternalProperty(Box<ExternalProperty>),
709 FallbackProperty(Box<FallbackProperty>),
710 FileFormatProperty(Box<FileFormatProperty>),
711 CredentialsProperty(Box<CredentialsProperty>),
712 FreespaceProperty(Box<FreespaceProperty>),
713 InheritsProperty(Box<InheritsProperty>),
714 InputModelProperty(Box<InputModelProperty>),
715 OutputModelProperty(Box<OutputModelProperty>),
716 IsolatedLoadingProperty(Box<IsolatedLoadingProperty>),
717 JournalProperty(Box<JournalProperty>),
718 LanguageProperty(Box<LanguageProperty>),
719 EnviromentProperty(Box<EnviromentProperty>),
720 ClusteredByProperty(Box<ClusteredByProperty>),
721 DictProperty(Box<DictProperty>),
722 DictRange(Box<DictRange>),
723 OnCluster(Box<OnCluster>),
724 LikeProperty(Box<LikeProperty>),
725 LocationProperty(Box<LocationProperty>),
726 LockProperty(Box<LockProperty>),
727 LockingProperty(Box<LockingProperty>),
728 LogProperty(Box<LogProperty>),
729 MaterializedProperty(Box<MaterializedProperty>),
730 MergeBlockRatioProperty(Box<MergeBlockRatioProperty>),
731 OnProperty(Box<OnProperty>),
732 OnCommitProperty(Box<OnCommitProperty>),
733 PartitionedByProperty(Box<PartitionedByProperty>),
734 PartitionedByBucket(Box<PartitionedByBucket>),
735 PartitionByTruncate(Box<PartitionByTruncate>),
736 PartitionByRangeProperty(Box<PartitionByRangeProperty>),
737 PartitionByRangePropertyDynamic(Box<PartitionByRangePropertyDynamic>),
738 PartitionByListProperty(Box<PartitionByListProperty>),
739 PartitionList(Box<PartitionList>),
740 Partition(Box<Partition>),
741 RefreshTriggerProperty(Box<RefreshTriggerProperty>),
742 UniqueKeyProperty(Box<UniqueKeyProperty>),
743 RollupProperty(Box<RollupProperty>),
744 PartitionBoundSpec(Box<PartitionBoundSpec>),
745 PartitionedOfProperty(Box<PartitionedOfProperty>),
746 RemoteWithConnectionModelProperty(Box<RemoteWithConnectionModelProperty>),
747 ReturnsProperty(Box<ReturnsProperty>),
748 RowFormatProperty(Box<RowFormatProperty>),
749 RowFormatDelimitedProperty(Box<RowFormatDelimitedProperty>),
750 RowFormatSerdeProperty(Box<RowFormatSerdeProperty>),
751 QueryTransform(Box<QueryTransform>),
752 SampleProperty(Box<SampleProperty>),
753 SecurityProperty(Box<SecurityProperty>),
754 SchemaCommentProperty(Box<SchemaCommentProperty>),
755 SemanticView(Box<SemanticView>),
756 SerdeProperties(Box<SerdeProperties>),
757 SetProperty(Box<SetProperty>),
758 SharingProperty(Box<SharingProperty>),
759 SetConfigProperty(Box<SetConfigProperty>),
760 SettingsProperty(Box<SettingsProperty>),
761 SortKeyProperty(Box<SortKeyProperty>),
762 SqlReadWriteProperty(Box<SqlReadWriteProperty>),
763 SqlSecurityProperty(Box<SqlSecurityProperty>),
764 StabilityProperty(Box<StabilityProperty>),
765 StorageHandlerProperty(Box<StorageHandlerProperty>),
766 TemporaryProperty(Box<TemporaryProperty>),
767 Tags(Box<Tags>),
768 TransformModelProperty(Box<TransformModelProperty>),
769 TransientProperty(Box<TransientProperty>),
770 UsingTemplateProperty(Box<UsingTemplateProperty>),
771 ViewAttributeProperty(Box<ViewAttributeProperty>),
772 VolatileProperty(Box<VolatileProperty>),
773 WithDataProperty(Box<WithDataProperty>),
774 WithJournalTableProperty(Box<WithJournalTableProperty>),
775 WithSchemaBindingProperty(Box<WithSchemaBindingProperty>),
776 WithSystemVersioningProperty(Box<WithSystemVersioningProperty>),
777 WithProcedureOptions(Box<WithProcedureOptions>),
778 EncodeProperty(Box<EncodeProperty>),
779 IncludeProperty(Box<IncludeProperty>),
780 Properties(Box<Properties>),
781 InputOutputFormat(Box<InputOutputFormat>),
782 Reference(Box<Reference>),
783 QueryOption(Box<QueryOption>),
784 WithTableHint(Box<WithTableHint>),
785 IndexTableHint(Box<IndexTableHint>),
786 HistoricalData(Box<HistoricalData>),
787 Get(Box<Get>),
788 SetOperation(Box<SetOperation>),
789 Var(Box<Var>),
790 Variadic(Box<Variadic>),
791 Version(Box<Version>),
792 Schema(Box<Schema>),
793 Lock(Box<Lock>),
794 TableSample(Box<TableSample>),
795 Tag(Box<Tag>),
796 UnpivotColumns(Box<UnpivotColumns>),
797 WindowSpec(Box<WindowSpec>),
798 SessionParameter(Box<SessionParameter>),
799 PseudoType(Box<PseudoType>),
800 ObjectIdentifier(Box<ObjectIdentifier>),
801 Transaction(Box<Transaction>),
802 Commit(Box<Commit>),
803 Rollback(Box<Rollback>),
804 AlterSession(Box<AlterSession>),
805 Analyze(Box<Analyze>),
806 AnalyzeStatistics(Box<AnalyzeStatistics>),
807 AnalyzeHistogram(Box<AnalyzeHistogram>),
808 AnalyzeSample(Box<AnalyzeSample>),
809 AnalyzeListChainedRows(Box<AnalyzeListChainedRows>),
810 AnalyzeDelete(Box<AnalyzeDelete>),
811 AnalyzeWith(Box<AnalyzeWith>),
812 AnalyzeValidate(Box<AnalyzeValidate>),
813 AddPartition(Box<AddPartition>),
814 AttachOption(Box<AttachOption>),
815 DropPartition(Box<DropPartition>),
816 ReplacePartition(Box<ReplacePartition>),
817 DPipe(Box<DPipe>),
818 Operator(Box<Operator>),
819 PivotAny(Box<PivotAny>),
820 Aliases(Box<Aliases>),
821 AtIndex(Box<AtIndex>),
822 FromTimeZone(Box<FromTimeZone>),
823 FormatPhrase(Box<FormatPhrase>),
824 ForIn(Box<ForIn>),
825 TimeUnit(Box<TimeUnit>),
826 IntervalOp(Box<IntervalOp>),
827 IntervalSpan(Box<IntervalSpan>),
828 HavingMax(Box<HavingMax>),
829 CosineDistance(Box<CosineDistance>),
830 DotProduct(Box<DotProduct>),
831 EuclideanDistance(Box<EuclideanDistance>),
832 ManhattanDistance(Box<ManhattanDistance>),
833 JarowinklerSimilarity(Box<JarowinklerSimilarity>),
834 Booland(Box<Booland>),
835 Boolor(Box<Boolor>),
836 ParameterizedAgg(Box<ParameterizedAgg>),
837 ArgMax(Box<ArgMax>),
838 ArgMin(Box<ArgMin>),
839 ApproxTopK(Box<ApproxTopK>),
840 ApproxTopKAccumulate(Box<ApproxTopKAccumulate>),
841 ApproxTopKCombine(Box<ApproxTopKCombine>),
842 ApproxTopKEstimate(Box<ApproxTopKEstimate>),
843 ApproxTopSum(Box<ApproxTopSum>),
844 ApproxQuantiles(Box<ApproxQuantiles>),
845 Minhash(Box<Minhash>),
846 FarmFingerprint(Box<FarmFingerprint>),
847 Float64(Box<Float64>),
848 Transform(Box<Transform>),
849 Translate(Box<Translate>),
850 Grouping(Box<Grouping>),
851 GroupingId(Box<GroupingId>),
852 Anonymous(Box<Anonymous>),
853 AnonymousAggFunc(Box<AnonymousAggFunc>),
854 CombinedAggFunc(Box<CombinedAggFunc>),
855 CombinedParameterizedAgg(Box<CombinedParameterizedAgg>),
856 HashAgg(Box<HashAgg>),
857 Hll(Box<Hll>),
858 Apply(Box<Apply>),
859 ToBoolean(Box<ToBoolean>),
860 List(Box<List>),
861 ToMap(Box<ToMap>),
862 Pad(Box<Pad>),
863 ToChar(Box<ToChar>),
864 ToNumber(Box<ToNumber>),
865 ToDouble(Box<ToDouble>),
866 Int64(Box<UnaryFunc>),
867 StringFunc(Box<StringFunc>),
868 ToDecfloat(Box<ToDecfloat>),
869 TryToDecfloat(Box<TryToDecfloat>),
870 ToFile(Box<ToFile>),
871 Columns(Box<Columns>),
872 ConvertToCharset(Box<ConvertToCharset>),
873 ConvertTimezone(Box<ConvertTimezone>),
874 GenerateSeries(Box<GenerateSeries>),
875 AIAgg(Box<AIAgg>),
876 AIClassify(Box<AIClassify>),
877 ArrayAll(Box<ArrayAll>),
878 ArrayAny(Box<ArrayAny>),
879 ArrayConstructCompact(Box<ArrayConstructCompact>),
880 StPoint(Box<StPoint>),
881 StDistance(Box<StDistance>),
882 StringToArray(Box<StringToArray>),
883 ArraySum(Box<ArraySum>),
884 ObjectAgg(Box<ObjectAgg>),
885 CastToStrType(Box<CastToStrType>),
886 CheckJson(Box<CheckJson>),
887 CheckXml(Box<CheckXml>),
888 TranslateCharacters(Box<TranslateCharacters>),
889 CurrentSchemas(Box<CurrentSchemas>),
890 CurrentDatetime(Box<CurrentDatetime>),
891 Localtime(Box<Localtime>),
892 Localtimestamp(Box<Localtimestamp>),
893 Systimestamp(Box<Systimestamp>),
894 CurrentSchema(Box<CurrentSchema>),
895 CurrentUser(Box<CurrentUser>),
896 UtcTime(Box<UtcTime>),
897 UtcTimestamp(Box<UtcTimestamp>),
898 Timestamp(Box<TimestampFunc>),
899 DateBin(Box<DateBin>),
900 Datetime(Box<Datetime>),
901 DatetimeAdd(Box<DatetimeAdd>),
902 DatetimeSub(Box<DatetimeSub>),
903 DatetimeDiff(Box<DatetimeDiff>),
904 DatetimeTrunc(Box<DatetimeTrunc>),
905 Dayname(Box<Dayname>),
906 MakeInterval(Box<MakeInterval>),
907 PreviousDay(Box<PreviousDay>),
908 Elt(Box<Elt>),
909 TimestampAdd(Box<TimestampAdd>),
910 TimestampSub(Box<TimestampSub>),
911 TimestampDiff(Box<TimestampDiff>),
912 TimeSlice(Box<TimeSlice>),
913 TimeAdd(Box<TimeAdd>),
914 TimeSub(Box<TimeSub>),
915 TimeDiff(Box<TimeDiff>),
916 TimeTrunc(Box<TimeTrunc>),
917 DateFromParts(Box<DateFromParts>),
918 TimeFromParts(Box<TimeFromParts>),
919 DecodeCase(Box<DecodeCase>),
920 Decrypt(Box<Decrypt>),
921 DecryptRaw(Box<DecryptRaw>),
922 Encode(Box<Encode>),
923 Encrypt(Box<Encrypt>),
924 EncryptRaw(Box<EncryptRaw>),
925 EqualNull(Box<EqualNull>),
926 ToBinary(Box<ToBinary>),
927 Base64DecodeBinary(Box<Base64DecodeBinary>),
928 Base64DecodeString(Box<Base64DecodeString>),
929 Base64Encode(Box<Base64Encode>),
930 TryBase64DecodeBinary(Box<TryBase64DecodeBinary>),
931 TryBase64DecodeString(Box<TryBase64DecodeString>),
932 GapFill(Box<GapFill>),
933 GenerateDateArray(Box<GenerateDateArray>),
934 GenerateTimestampArray(Box<GenerateTimestampArray>),
935 GetExtract(Box<GetExtract>),
936 Getbit(Box<Getbit>),
937 OverflowTruncateBehavior(Box<OverflowTruncateBehavior>),
938 HexEncode(Box<HexEncode>),
939 Compress(Box<Compress>),
940 DecompressBinary(Box<DecompressBinary>),
941 DecompressString(Box<DecompressString>),
942 Xor(Box<Xor>),
943 Nullif(Box<Nullif>),
944 JSON(Box<JSON>),
945 JSONPath(Box<JSONPath>),
946 JSONPathFilter(Box<JSONPathFilter>),
947 JSONPathKey(Box<JSONPathKey>),
948 JSONPathRecursive(Box<JSONPathRecursive>),
949 JSONPathScript(Box<JSONPathScript>),
950 JSONPathSlice(Box<JSONPathSlice>),
951 JSONPathSelector(Box<JSONPathSelector>),
952 JSONPathSubscript(Box<JSONPathSubscript>),
953 JSONPathUnion(Box<JSONPathUnion>),
954 Format(Box<Format>),
955 JSONKeys(Box<JSONKeys>),
956 JSONKeyValue(Box<JSONKeyValue>),
957 JSONKeysAtDepth(Box<JSONKeysAtDepth>),
958 JSONObject(Box<JSONObject>),
959 JSONObjectAgg(Box<JSONObjectAgg>),
960 JSONBObjectAgg(Box<JSONBObjectAgg>),
961 JSONArray(Box<JSONArray>),
962 JSONArrayAgg(Box<JSONArrayAgg>),
963 JSONExists(Box<JSONExists>),
964 JSONColumnDef(Box<JSONColumnDef>),
965 JSONSchema(Box<JSONSchema>),
966 JSONSet(Box<JSONSet>),
967 JSONStripNulls(Box<JSONStripNulls>),
968 JSONValue(Box<JSONValue>),
969 JSONValueArray(Box<JSONValueArray>),
970 JSONRemove(Box<JSONRemove>),
971 JSONTable(Box<JSONTable>),
972 JSONType(Box<JSONType>),
973 ObjectInsert(Box<ObjectInsert>),
974 OpenJSONColumnDef(Box<OpenJSONColumnDef>),
975 OpenJSON(Box<OpenJSON>),
976 JSONBExists(Box<JSONBExists>),
977 JSONBContains(Box<BinaryFunc>),
978 JSONBExtract(Box<BinaryFunc>),
979 JSONCast(Box<JSONCast>),
980 JSONExtract(Box<JSONExtract>),
981 JSONExtractQuote(Box<JSONExtractQuote>),
982 JSONExtractArray(Box<JSONExtractArray>),
983 JSONExtractScalar(Box<JSONExtractScalar>),
984 JSONBExtractScalar(Box<JSONBExtractScalar>),
985 JSONFormat(Box<JSONFormat>),
986 JSONBool(Box<UnaryFunc>),
987 JSONPathRoot(JSONPathRoot),
988 JSONArrayAppend(Box<JSONArrayAppend>),
989 JSONArrayContains(Box<JSONArrayContains>),
990 JSONArrayInsert(Box<JSONArrayInsert>),
991 ParseJSON(Box<ParseJSON>),
992 ParseUrl(Box<ParseUrl>),
993 ParseIp(Box<ParseIp>),
994 ParseTime(Box<ParseTime>),
995 ParseDatetime(Box<ParseDatetime>),
996 Map(Box<Map>),
997 MapCat(Box<MapCat>),
998 MapDelete(Box<MapDelete>),
999 MapInsert(Box<MapInsert>),
1000 MapPick(Box<MapPick>),
1001 ScopeResolution(Box<ScopeResolution>),
1002 Slice(Box<Slice>),
1003 VarMap(Box<VarMap>),
1004 MatchAgainst(Box<MatchAgainst>),
1005 MD5Digest(Box<MD5Digest>),
1006 MD5NumberLower64(Box<UnaryFunc>),
1007 MD5NumberUpper64(Box<UnaryFunc>),
1008 Monthname(Box<Monthname>),
1009 Ntile(Box<Ntile>),
1010 Normalize(Box<Normalize>),
1011 Normal(Box<Normal>),
1012 Predict(Box<Predict>),
1013 MLTranslate(Box<MLTranslate>),
1014 FeaturesAtTime(Box<FeaturesAtTime>),
1015 GenerateEmbedding(Box<GenerateEmbedding>),
1016 MLForecast(Box<MLForecast>),
1017 ModelAttribute(Box<ModelAttribute>),
1018 VectorSearch(Box<VectorSearch>),
1019 Quantile(Box<Quantile>),
1020 ApproxQuantile(Box<ApproxQuantile>),
1021 ApproxPercentileEstimate(Box<ApproxPercentileEstimate>),
1022 Randn(Box<Randn>),
1023 Randstr(Box<Randstr>),
1024 RangeN(Box<RangeN>),
1025 RangeBucket(Box<RangeBucket>),
1026 ReadCSV(Box<ReadCSV>),
1027 ReadParquet(Box<ReadParquet>),
1028 Reduce(Box<Reduce>),
1029 RegexpExtractAll(Box<RegexpExtractAll>),
1030 RegexpILike(Box<RegexpILike>),
1031 RegexpFullMatch(Box<RegexpFullMatch>),
1032 RegexpInstr(Box<RegexpInstr>),
1033 RegexpSplit(Box<RegexpSplit>),
1034 RegexpCount(Box<RegexpCount>),
1035 RegrValx(Box<RegrValx>),
1036 RegrValy(Box<RegrValy>),
1037 RegrAvgy(Box<RegrAvgy>),
1038 RegrAvgx(Box<RegrAvgx>),
1039 RegrCount(Box<RegrCount>),
1040 RegrIntercept(Box<RegrIntercept>),
1041 RegrR2(Box<RegrR2>),
1042 RegrSxx(Box<RegrSxx>),
1043 RegrSxy(Box<RegrSxy>),
1044 RegrSyy(Box<RegrSyy>),
1045 RegrSlope(Box<RegrSlope>),
1046 SafeAdd(Box<SafeAdd>),
1047 SafeDivide(Box<SafeDivide>),
1048 SafeMultiply(Box<SafeMultiply>),
1049 SafeSubtract(Box<SafeSubtract>),
1050 SHA2(Box<SHA2>),
1051 SHA2Digest(Box<SHA2Digest>),
1052 SortArray(Box<SortArray>),
1053 SplitPart(Box<SplitPart>),
1054 SubstringIndex(Box<SubstringIndex>),
1055 StandardHash(Box<StandardHash>),
1056 StrPosition(Box<StrPosition>),
1057 Search(Box<Search>),
1058 SearchIp(Box<SearchIp>),
1059 StrToDate(Box<StrToDate>),
1060 DateStrToDate(Box<UnaryFunc>),
1061 DateToDateStr(Box<UnaryFunc>),
1062 StrToTime(Box<StrToTime>),
1063 StrToUnix(Box<StrToUnix>),
1064 StrToMap(Box<StrToMap>),
1065 NumberToStr(Box<NumberToStr>),
1066 FromBase(Box<FromBase>),
1067 Stuff(Box<Stuff>),
1068 TimeToStr(Box<TimeToStr>),
1069 TimeStrToTime(Box<TimeStrToTime>),
1070 TsOrDsAdd(Box<TsOrDsAdd>),
1071 TsOrDsDiff(Box<TsOrDsDiff>),
1072 TsOrDsToDate(Box<TsOrDsToDate>),
1073 TsOrDsToTime(Box<TsOrDsToTime>),
1074 Unhex(Box<Unhex>),
1075 Uniform(Box<Uniform>),
1076 UnixToStr(Box<UnixToStr>),
1077 UnixToTime(Box<UnixToTime>),
1078 Uuid(Box<Uuid>),
1079 TimestampFromParts(Box<TimestampFromParts>),
1080 TimestampTzFromParts(Box<TimestampTzFromParts>),
1081 Corr(Box<Corr>),
1082 WidthBucket(Box<WidthBucket>),
1083 CovarSamp(Box<CovarSamp>),
1084 CovarPop(Box<CovarPop>),
1085 Week(Box<Week>),
1086 XMLElement(Box<XMLElement>),
1087 XMLGet(Box<XMLGet>),
1088 XMLTable(Box<XMLTable>),
1089 XMLKeyValueOption(Box<XMLKeyValueOption>),
1090 Zipf(Box<Zipf>),
1091 Merge(Box<Merge>),
1092 When(Box<When>),
1093 Whens(Box<Whens>),
1094 NextValueFor(Box<NextValueFor>),
1095 ReturnStmt(Box<Expression>),
1097}
1098
1099impl Expression {
1100 pub fn is_statement(&self) -> bool {
1107 match self {
1108 Expression::Select(_)
1110 | Expression::Union(_)
1111 | Expression::Intersect(_)
1112 | Expression::Except(_)
1113 | Expression::Subquery(_)
1114 | Expression::Values(_)
1115 | Expression::PipeOperator(_)
1116
1117 | Expression::Insert(_)
1119 | Expression::Update(_)
1120 | Expression::Delete(_)
1121 | Expression::Copy(_)
1122 | Expression::Put(_)
1123 | Expression::Merge(_)
1124
1125 | Expression::CreateTable(_)
1127 | Expression::DropTable(_)
1128 | Expression::AlterTable(_)
1129 | Expression::CreateIndex(_)
1130 | Expression::DropIndex(_)
1131 | Expression::CreateView(_)
1132 | Expression::DropView(_)
1133 | Expression::AlterView(_)
1134 | Expression::AlterIndex(_)
1135 | Expression::Truncate(_)
1136 | Expression::TruncateTable(_)
1137 | Expression::CreateSchema(_)
1138 | Expression::DropSchema(_)
1139 | Expression::DropNamespace(_)
1140 | Expression::CreateDatabase(_)
1141 | Expression::DropDatabase(_)
1142 | Expression::CreateFunction(_)
1143 | Expression::DropFunction(_)
1144 | Expression::CreateProcedure(_)
1145 | Expression::DropProcedure(_)
1146 | Expression::CreateSequence(_)
1147 | Expression::DropSequence(_)
1148 | Expression::AlterSequence(_)
1149 | Expression::CreateTrigger(_)
1150 | Expression::DropTrigger(_)
1151 | Expression::CreateType(_)
1152 | Expression::DropType(_)
1153 | Expression::Comment(_)
1154
1155 | Expression::Use(_)
1157 | Expression::Set(_)
1158 | Expression::SetStatement(_)
1159 | Expression::Transaction(_)
1160 | Expression::Commit(_)
1161 | Expression::Rollback(_)
1162 | Expression::Grant(_)
1163 | Expression::Revoke(_)
1164 | Expression::Cache(_)
1165 | Expression::Uncache(_)
1166 | Expression::LoadData(_)
1167 | Expression::Pragma(_)
1168 | Expression::Describe(_)
1169 | Expression::Show(_)
1170 | Expression::Kill(_)
1171 | Expression::Execute(_)
1172 | Expression::Declare(_)
1173 | Expression::Refresh(_)
1174 | Expression::AlterSession(_)
1175 | Expression::LockingStatement(_)
1176
1177 | Expression::Analyze(_)
1179 | Expression::AnalyzeStatistics(_)
1180 | Expression::AnalyzeHistogram(_)
1181 | Expression::AnalyzeSample(_)
1182 | Expression::AnalyzeListChainedRows(_)
1183 | Expression::AnalyzeDelete(_)
1184
1185 | Expression::Attach(_)
1187 | Expression::Detach(_)
1188 | Expression::Install(_)
1189 | Expression::Summarize(_)
1190
1191 | Expression::Pivot(_)
1193 | Expression::Unpivot(_)
1194
1195 | Expression::Command(_)
1197 | Expression::Raw(_)
1198
1199 | Expression::ReturnStmt(_) => true,
1201
1202 Expression::Annotated(a) => a.this.is_statement(),
1204
1205 Expression::Alias(a) => a.this.is_statement(),
1207
1208 _ => false,
1210 }
1211 }
1212
1213 pub fn number(n: i64) -> Self {
1215 Expression::Literal(Literal::Number(n.to_string()))
1216 }
1217
1218 pub fn string(s: impl Into<String>) -> Self {
1220 Expression::Literal(Literal::String(s.into()))
1221 }
1222
1223 pub fn float(f: f64) -> Self {
1225 Expression::Literal(Literal::Number(f.to_string()))
1226 }
1227
1228 pub fn column(name: impl Into<String>) -> Self {
1230 Expression::Column(Column {
1231 name: Identifier::new(name),
1232 table: None,
1233 join_mark: false,
1234 trailing_comments: Vec::new(),
1235 })
1236 }
1237
1238 pub fn qualified_column(table: impl Into<String>, column: impl Into<String>) -> Self {
1240 Expression::Column(Column {
1241 name: Identifier::new(column),
1242 table: Some(Identifier::new(table)),
1243 join_mark: false,
1244 trailing_comments: Vec::new(),
1245 })
1246 }
1247
1248 pub fn identifier(name: impl Into<String>) -> Self {
1250 Expression::Identifier(Identifier::new(name))
1251 }
1252
1253 pub fn null() -> Self {
1255 Expression::Null(Null)
1256 }
1257
1258 pub fn true_() -> Self {
1260 Expression::Boolean(BooleanLiteral { value: true })
1261 }
1262
1263 pub fn false_() -> Self {
1265 Expression::Boolean(BooleanLiteral { value: false })
1266 }
1267
1268 pub fn star() -> Self {
1270 Expression::Star(Star {
1271 table: None,
1272 except: None,
1273 replace: None,
1274 rename: None,
1275 trailing_comments: Vec::new(),
1276 })
1277 }
1278
1279 pub fn alias(self, name: impl Into<String>) -> Self {
1281 Expression::Alias(Box::new(Alias::new(self, Identifier::new(name))))
1282 }
1283
1284 pub fn is_select(&self) -> bool {
1286 matches!(self, Expression::Select(_))
1287 }
1288
1289 pub fn as_select(&self) -> Option<&Select> {
1291 match self {
1292 Expression::Select(s) => Some(s),
1293 _ => None,
1294 }
1295 }
1296
1297 pub fn as_select_mut(&mut self) -> Option<&mut Select> {
1299 match self {
1300 Expression::Select(s) => Some(s),
1301 _ => None,
1302 }
1303 }
1304
1305 pub fn sql(&self) -> String {
1310 crate::generator::Generator::sql(self).unwrap_or_default()
1311 }
1312
1313 pub fn sql_for(&self, dialect: crate::dialects::DialectType) -> String {
1319 crate::generate(self, dialect).unwrap_or_default()
1320 }
1321}
1322
1323impl fmt::Display for Expression {
1324 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1325 match self {
1327 Expression::Literal(lit) => write!(f, "{}", lit),
1328 Expression::Identifier(id) => write!(f, "{}", id),
1329 Expression::Column(col) => write!(f, "{}", col),
1330 Expression::Star(_) => write!(f, "*"),
1331 Expression::Null(_) => write!(f, "NULL"),
1332 Expression::Boolean(b) => write!(f, "{}", if b.value { "TRUE" } else { "FALSE" }),
1333 Expression::Select(_) => write!(f, "SELECT ..."),
1334 _ => write!(f, "{:?}", self),
1335 }
1336 }
1337}
1338
1339#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1349#[cfg_attr(feature = "bindings", derive(TS))]
1350#[serde(tag = "literal_type", content = "value", rename_all = "snake_case")]
1351pub enum Literal {
1352 String(String),
1354 Number(String),
1356 HexString(String),
1358 HexNumber(String),
1360 BitString(String),
1361 ByteString(String),
1363 NationalString(String),
1365 Date(String),
1367 Time(String),
1369 Timestamp(String),
1371 Datetime(String),
1373 TripleQuotedString(String, char),
1376 EscapeString(String),
1378 DollarString(String),
1380 RawString(String),
1384}
1385
1386impl fmt::Display for Literal {
1387 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1388 match self {
1389 Literal::String(s) => write!(f, "'{}'", s),
1390 Literal::Number(n) => write!(f, "{}", n),
1391 Literal::HexString(h) => write!(f, "X'{}'", h),
1392 Literal::HexNumber(h) => write!(f, "0x{}", h),
1393 Literal::BitString(b) => write!(f, "B'{}'", b),
1394 Literal::ByteString(b) => write!(f, "b'{}'", b),
1395 Literal::NationalString(s) => write!(f, "N'{}'", s),
1396 Literal::Date(d) => write!(f, "DATE '{}'", d),
1397 Literal::Time(t) => write!(f, "TIME '{}'", t),
1398 Literal::Timestamp(ts) => write!(f, "TIMESTAMP '{}'", ts),
1399 Literal::Datetime(dt) => write!(f, "DATETIME '{}'", dt),
1400 Literal::TripleQuotedString(s, q) => {
1401 write!(f, "{0}{0}{0}{1}{0}{0}{0}", q, s)
1402 }
1403 Literal::EscapeString(s) => write!(f, "E'{}'", s),
1404 Literal::DollarString(s) => write!(f, "$${}$$", s),
1405 Literal::RawString(s) => write!(f, "r'{}'", s),
1406 }
1407 }
1408}
1409
1410#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1412#[cfg_attr(feature = "bindings", derive(TS))]
1413pub struct BooleanLiteral {
1414 pub value: bool,
1415}
1416
1417#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1419#[cfg_attr(feature = "bindings", derive(TS))]
1420pub struct Null;
1421
1422#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1429#[cfg_attr(feature = "bindings", derive(TS))]
1430pub struct Identifier {
1431 pub name: String,
1433 pub quoted: bool,
1435 #[serde(default)]
1436 pub trailing_comments: Vec<String>,
1437}
1438
1439impl Identifier {
1440 pub fn new(name: impl Into<String>) -> Self {
1441 Self {
1442 name: name.into(),
1443 quoted: false,
1444 trailing_comments: Vec::new(),
1445 }
1446 }
1447
1448 pub fn quoted(name: impl Into<String>) -> Self {
1449 Self {
1450 name: name.into(),
1451 quoted: true,
1452 trailing_comments: Vec::new(),
1453 }
1454 }
1455
1456 pub fn empty() -> Self {
1457 Self {
1458 name: String::new(),
1459 quoted: false,
1460 trailing_comments: Vec::new(),
1461 }
1462 }
1463
1464 pub fn is_empty(&self) -> bool {
1465 self.name.is_empty()
1466 }
1467}
1468
1469impl fmt::Display for Identifier {
1470 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1471 if self.quoted {
1472 write!(f, "\"{}\"", self.name)
1473 } else {
1474 write!(f, "{}", self.name)
1475 }
1476 }
1477}
1478
1479#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1485#[cfg_attr(feature = "bindings", derive(TS))]
1486pub struct Column {
1487 pub name: Identifier,
1489 pub table: Option<Identifier>,
1491 #[serde(default)]
1493 pub join_mark: bool,
1494 #[serde(default)]
1496 pub trailing_comments: Vec<String>,
1497}
1498
1499impl fmt::Display for Column {
1500 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1501 if let Some(table) = &self.table {
1502 write!(f, "{}.{}", table, self.name)
1503 } else {
1504 write!(f, "{}", self.name)
1505 }
1506 }
1507}
1508
1509#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1516#[cfg_attr(feature = "bindings", derive(TS))]
1517pub struct TableRef {
1518 pub name: Identifier,
1520 pub schema: Option<Identifier>,
1522 pub catalog: Option<Identifier>,
1524 pub alias: Option<Identifier>,
1526 #[serde(default)]
1528 pub alias_explicit_as: bool,
1529 #[serde(default)]
1531 pub column_aliases: Vec<Identifier>,
1532 #[serde(default)]
1534 pub trailing_comments: Vec<String>,
1535 #[serde(default)]
1537 pub when: Option<Box<HistoricalData>>,
1538 #[serde(default)]
1540 pub only: bool,
1541 #[serde(default)]
1543 pub final_: bool,
1544 #[serde(default, skip_serializing_if = "Option::is_none")]
1546 pub table_sample: Option<Box<Sample>>,
1547 #[serde(default)]
1549 pub hints: Vec<Expression>,
1550 #[serde(default, skip_serializing_if = "Option::is_none")]
1553 pub system_time: Option<String>,
1554 #[serde(default, skip_serializing_if = "Vec::is_empty")]
1556 pub partitions: Vec<Identifier>,
1557 #[serde(default, skip_serializing_if = "Option::is_none")]
1560 pub identifier_func: Option<Box<Expression>>,
1561 #[serde(default, skip_serializing_if = "Option::is_none")]
1563 pub changes: Option<Box<Changes>>,
1564 #[serde(default, skip_serializing_if = "Option::is_none")]
1566 pub version: Option<Box<Version>>,
1567}
1568
1569impl TableRef {
1570 pub fn new(name: impl Into<String>) -> Self {
1571 Self {
1572 name: Identifier::new(name),
1573 schema: None,
1574 catalog: None,
1575 alias: None,
1576 alias_explicit_as: false,
1577 column_aliases: Vec::new(),
1578 trailing_comments: Vec::new(),
1579 when: None,
1580 only: false,
1581 final_: false,
1582 table_sample: None,
1583 hints: Vec::new(),
1584 system_time: None,
1585 partitions: Vec::new(),
1586 identifier_func: None,
1587 changes: None,
1588 version: None,
1589 }
1590 }
1591
1592 pub fn new_with_schema(name: impl Into<String>, schema: impl Into<String>) -> Self {
1594 let mut t = Self::new(name);
1595 t.schema = Some(Identifier::new(schema));
1596 t
1597 }
1598
1599 pub fn new_with_catalog(
1601 name: impl Into<String>,
1602 schema: impl Into<String>,
1603 catalog: impl Into<String>,
1604 ) -> Self {
1605 let mut t = Self::new(name);
1606 t.schema = Some(Identifier::new(schema));
1607 t.catalog = Some(Identifier::new(catalog));
1608 t
1609 }
1610
1611 pub fn from_identifier(name: Identifier) -> Self {
1613 Self {
1614 name,
1615 schema: None,
1616 catalog: None,
1617 alias: None,
1618 alias_explicit_as: false,
1619 column_aliases: Vec::new(),
1620 trailing_comments: Vec::new(),
1621 when: None,
1622 only: false,
1623 final_: false,
1624 table_sample: None,
1625 hints: Vec::new(),
1626 system_time: None,
1627 partitions: Vec::new(),
1628 identifier_func: None,
1629 changes: None,
1630 version: None,
1631 }
1632 }
1633
1634 pub fn with_alias(mut self, alias: impl Into<String>) -> Self {
1635 self.alias = Some(Identifier::new(alias));
1636 self
1637 }
1638
1639 pub fn with_schema(mut self, schema: impl Into<String>) -> Self {
1640 self.schema = Some(Identifier::new(schema));
1641 self
1642 }
1643}
1644
1645#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1650#[cfg_attr(feature = "bindings", derive(TS))]
1651pub struct Star {
1652 pub table: Option<Identifier>,
1654 pub except: Option<Vec<Identifier>>,
1656 pub replace: Option<Vec<Alias>>,
1658 pub rename: Option<Vec<(Identifier, Identifier)>>,
1660 #[serde(default, skip_serializing_if = "Vec::is_empty")]
1662 pub trailing_comments: Vec<String>,
1663}
1664
1665#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1689#[cfg_attr(feature = "bindings", derive(TS))]
1690pub struct Select {
1691 pub expressions: Vec<Expression>,
1693 pub from: Option<From>,
1695 pub joins: Vec<Join>,
1697 pub lateral_views: Vec<LateralView>,
1698 #[serde(default, skip_serializing_if = "Option::is_none")]
1700 pub prewhere: Option<Expression>,
1701 pub where_clause: Option<Where>,
1702 pub group_by: Option<GroupBy>,
1703 pub having: Option<Having>,
1704 pub qualify: Option<Qualify>,
1705 pub order_by: Option<OrderBy>,
1706 pub distribute_by: Option<DistributeBy>,
1707 pub cluster_by: Option<ClusterBy>,
1708 pub sort_by: Option<SortBy>,
1709 pub limit: Option<Limit>,
1710 pub offset: Option<Offset>,
1711 #[serde(default, skip_serializing_if = "Option::is_none")]
1713 pub limit_by: Option<Vec<Expression>>,
1714 pub fetch: Option<Fetch>,
1715 pub distinct: bool,
1716 pub distinct_on: Option<Vec<Expression>>,
1717 pub top: Option<Top>,
1718 pub with: Option<With>,
1719 pub sample: Option<Sample>,
1720 #[serde(default, skip_serializing_if = "Option::is_none")]
1722 pub settings: Option<Vec<Expression>>,
1723 #[serde(default, skip_serializing_if = "Option::is_none")]
1725 pub format: Option<Expression>,
1726 pub windows: Option<Vec<NamedWindow>>,
1727 pub hint: Option<Hint>,
1728 pub connect: Option<Connect>,
1730 pub into: Option<SelectInto>,
1732 #[serde(default)]
1734 pub locks: Vec<Lock>,
1735 #[serde(default, skip_serializing_if = "Vec::is_empty")]
1737 pub for_xml: Vec<Expression>,
1738 #[serde(default)]
1740 pub leading_comments: Vec<String>,
1741 #[serde(default, skip_serializing_if = "Vec::is_empty")]
1744 pub post_select_comments: Vec<String>,
1745 #[serde(default, skip_serializing_if = "Option::is_none")]
1747 pub kind: Option<String>,
1748 #[serde(default, skip_serializing_if = "Vec::is_empty")]
1750 pub operation_modifiers: Vec<String>,
1751 #[serde(default, skip_serializing_if = "std::ops::Not::not")]
1753 pub qualify_after_window: bool,
1754 #[serde(default, skip_serializing_if = "Option::is_none")]
1756 pub option: Option<String>,
1757}
1758
1759impl Select {
1760 pub fn new() -> Self {
1761 Self {
1762 expressions: Vec::new(),
1763 from: None,
1764 joins: Vec::new(),
1765 lateral_views: Vec::new(),
1766 prewhere: None,
1767 where_clause: None,
1768 group_by: None,
1769 having: None,
1770 qualify: None,
1771 order_by: None,
1772 distribute_by: None,
1773 cluster_by: None,
1774 sort_by: None,
1775 limit: None,
1776 offset: None,
1777 limit_by: None,
1778 fetch: None,
1779 distinct: false,
1780 distinct_on: None,
1781 top: None,
1782 with: None,
1783 sample: None,
1784 settings: None,
1785 format: None,
1786 windows: None,
1787 hint: None,
1788 connect: None,
1789 into: None,
1790 locks: Vec::new(),
1791 for_xml: Vec::new(),
1792 leading_comments: Vec::new(),
1793 post_select_comments: Vec::new(),
1794 kind: None,
1795 operation_modifiers: Vec::new(),
1796 qualify_after_window: false,
1797 option: None,
1798 }
1799 }
1800
1801 pub fn column(mut self, expr: Expression) -> Self {
1803 self.expressions.push(expr);
1804 self
1805 }
1806
1807 pub fn from(mut self, table: Expression) -> Self {
1809 self.from = Some(From {
1810 expressions: vec![table],
1811 });
1812 self
1813 }
1814
1815 pub fn where_(mut self, condition: Expression) -> Self {
1817 self.where_clause = Some(Where { this: condition });
1818 self
1819 }
1820
1821 pub fn distinct(mut self) -> Self {
1823 self.distinct = true;
1824 self
1825 }
1826
1827 pub fn join(mut self, join: Join) -> Self {
1829 self.joins.push(join);
1830 self
1831 }
1832
1833 pub fn order_by(mut self, expressions: Vec<Ordered>) -> Self {
1835 self.order_by = Some(OrderBy {
1836 expressions,
1837 siblings: false,
1838 comments: Vec::new(),
1839 });
1840 self
1841 }
1842
1843 pub fn limit(mut self, n: Expression) -> Self {
1845 self.limit = Some(Limit {
1846 this: n,
1847 percent: false,
1848 comments: Vec::new(),
1849 });
1850 self
1851 }
1852
1853 pub fn offset(mut self, n: Expression) -> Self {
1855 self.offset = Some(Offset {
1856 this: n,
1857 rows: None,
1858 });
1859 self
1860 }
1861}
1862
1863impl Default for Select {
1864 fn default() -> Self {
1865 Self::new()
1866 }
1867}
1868
1869#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1875#[cfg_attr(feature = "bindings", derive(TS))]
1876pub struct Union {
1877 pub left: Expression,
1879 pub right: Expression,
1881 pub all: bool,
1883 #[serde(default)]
1885 pub distinct: bool,
1886 pub with: Option<With>,
1888 pub order_by: Option<OrderBy>,
1890 pub limit: Option<Box<Expression>>,
1892 pub offset: Option<Box<Expression>>,
1894 #[serde(default, skip_serializing_if = "Option::is_none")]
1896 pub distribute_by: Option<DistributeBy>,
1897 #[serde(default, skip_serializing_if = "Option::is_none")]
1899 pub sort_by: Option<SortBy>,
1900 #[serde(default, skip_serializing_if = "Option::is_none")]
1902 pub cluster_by: Option<ClusterBy>,
1903 #[serde(default)]
1905 pub by_name: bool,
1906 #[serde(default, skip_serializing_if = "Option::is_none")]
1908 pub side: Option<String>,
1909 #[serde(default, skip_serializing_if = "Option::is_none")]
1911 pub kind: Option<String>,
1912 #[serde(default)]
1914 pub corresponding: bool,
1915 #[serde(default)]
1917 pub strict: bool,
1918 #[serde(default, skip_serializing_if = "Vec::is_empty")]
1920 pub on_columns: Vec<Expression>,
1921}
1922
1923#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1928#[cfg_attr(feature = "bindings", derive(TS))]
1929pub struct Intersect {
1930 pub left: Expression,
1932 pub right: Expression,
1934 pub all: bool,
1936 #[serde(default)]
1938 pub distinct: bool,
1939 pub with: Option<With>,
1941 pub order_by: Option<OrderBy>,
1943 pub limit: Option<Box<Expression>>,
1945 pub offset: Option<Box<Expression>>,
1947 #[serde(default, skip_serializing_if = "Option::is_none")]
1949 pub distribute_by: Option<DistributeBy>,
1950 #[serde(default, skip_serializing_if = "Option::is_none")]
1952 pub sort_by: Option<SortBy>,
1953 #[serde(default, skip_serializing_if = "Option::is_none")]
1955 pub cluster_by: Option<ClusterBy>,
1956 #[serde(default)]
1958 pub by_name: bool,
1959 #[serde(default, skip_serializing_if = "Option::is_none")]
1961 pub side: Option<String>,
1962 #[serde(default, skip_serializing_if = "Option::is_none")]
1964 pub kind: Option<String>,
1965 #[serde(default)]
1967 pub corresponding: bool,
1968 #[serde(default)]
1970 pub strict: bool,
1971 #[serde(default, skip_serializing_if = "Vec::is_empty")]
1973 pub on_columns: Vec<Expression>,
1974}
1975
1976#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1981#[cfg_attr(feature = "bindings", derive(TS))]
1982pub struct Except {
1983 pub left: Expression,
1985 pub right: Expression,
1987 pub all: bool,
1989 #[serde(default)]
1991 pub distinct: bool,
1992 pub with: Option<With>,
1994 pub order_by: Option<OrderBy>,
1996 pub limit: Option<Box<Expression>>,
1998 pub offset: Option<Box<Expression>>,
2000 #[serde(default, skip_serializing_if = "Option::is_none")]
2002 pub distribute_by: Option<DistributeBy>,
2003 #[serde(default, skip_serializing_if = "Option::is_none")]
2005 pub sort_by: Option<SortBy>,
2006 #[serde(default, skip_serializing_if = "Option::is_none")]
2008 pub cluster_by: Option<ClusterBy>,
2009 #[serde(default)]
2011 pub by_name: bool,
2012 #[serde(default, skip_serializing_if = "Option::is_none")]
2014 pub side: Option<String>,
2015 #[serde(default, skip_serializing_if = "Option::is_none")]
2017 pub kind: Option<String>,
2018 #[serde(default)]
2020 pub corresponding: bool,
2021 #[serde(default)]
2023 pub strict: bool,
2024 #[serde(default, skip_serializing_if = "Vec::is_empty")]
2026 pub on_columns: Vec<Expression>,
2027}
2028
2029#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2031#[cfg_attr(feature = "bindings", derive(TS))]
2032pub struct SelectInto {
2033 pub this: Expression,
2035 #[serde(default)]
2037 pub temporary: bool,
2038 #[serde(default)]
2040 pub unlogged: bool,
2041 #[serde(default)]
2043 pub bulk_collect: bool,
2044 #[serde(default, skip_serializing_if = "Vec::is_empty")]
2046 pub expressions: Vec<Expression>,
2047}
2048
2049#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2059#[cfg_attr(feature = "bindings", derive(TS))]
2060pub struct Subquery {
2061 pub this: Expression,
2063 pub alias: Option<Identifier>,
2065 pub column_aliases: Vec<Identifier>,
2067 pub order_by: Option<OrderBy>,
2069 pub limit: Option<Limit>,
2071 pub offset: Option<Offset>,
2073 #[serde(default, skip_serializing_if = "Option::is_none")]
2075 pub distribute_by: Option<DistributeBy>,
2076 #[serde(default, skip_serializing_if = "Option::is_none")]
2078 pub sort_by: Option<SortBy>,
2079 #[serde(default, skip_serializing_if = "Option::is_none")]
2081 pub cluster_by: Option<ClusterBy>,
2082 #[serde(default)]
2084 pub lateral: bool,
2085 #[serde(default)]
2089 pub modifiers_inside: bool,
2090 #[serde(default)]
2092 pub trailing_comments: Vec<String>,
2093}
2094
2095#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2100#[cfg_attr(feature = "bindings", derive(TS))]
2101pub struct PipeOperator {
2102 pub this: Expression,
2104 pub expression: Expression,
2106}
2107
2108#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2110#[cfg_attr(feature = "bindings", derive(TS))]
2111pub struct Values {
2112 pub expressions: Vec<Tuple>,
2114 pub alias: Option<Identifier>,
2116 pub column_aliases: Vec<Identifier>,
2118}
2119
2120#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2130#[cfg_attr(feature = "bindings", derive(TS))]
2131pub struct Pivot {
2132 pub this: Expression,
2134 #[serde(default)]
2137 pub expressions: Vec<Expression>,
2138 #[serde(default)]
2140 pub fields: Vec<Expression>,
2141 #[serde(default)]
2143 pub using: Vec<Expression>,
2144 #[serde(default)]
2146 pub group: Option<Box<Expression>>,
2147 #[serde(default)]
2149 pub unpivot: bool,
2150 #[serde(default)]
2152 pub into: Option<Box<Expression>>,
2153 #[serde(default)]
2155 pub alias: Option<Identifier>,
2156 #[serde(default)]
2158 pub include_nulls: Option<bool>,
2159 #[serde(default)]
2161 pub default_on_null: Option<Box<Expression>>,
2162 #[serde(default, skip_serializing_if = "Option::is_none")]
2164 pub with: Option<With>,
2165}
2166
2167#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2169#[cfg_attr(feature = "bindings", derive(TS))]
2170pub struct Unpivot {
2171 pub this: Expression,
2172 pub value_column: Identifier,
2173 pub name_column: Identifier,
2174 pub columns: Vec<Expression>,
2175 pub alias: Option<Identifier>,
2176 #[serde(default)]
2178 pub value_column_parenthesized: bool,
2179 #[serde(default)]
2181 pub include_nulls: Option<bool>,
2182 #[serde(default, skip_serializing_if = "Vec::is_empty")]
2184 pub extra_value_columns: Vec<Identifier>,
2185}
2186
2187#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2190#[cfg_attr(feature = "bindings", derive(TS))]
2191pub struct PivotAlias {
2192 pub this: Expression,
2193 pub alias: Expression,
2194}
2195
2196#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2198#[cfg_attr(feature = "bindings", derive(TS))]
2199pub struct PreWhere {
2200 pub this: Expression,
2201}
2202
2203#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2205#[cfg_attr(feature = "bindings", derive(TS))]
2206pub struct Stream {
2207 pub this: Expression,
2208 #[serde(skip_serializing_if = "Option::is_none")]
2209 pub on: Option<Expression>,
2210 #[serde(skip_serializing_if = "Option::is_none")]
2211 pub show_initial_rows: Option<bool>,
2212}
2213
2214#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2216#[cfg_attr(feature = "bindings", derive(TS))]
2217pub struct UsingData {
2218 pub this: Expression,
2219}
2220
2221#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2223#[cfg_attr(feature = "bindings", derive(TS))]
2224pub struct XmlNamespace {
2225 pub this: Expression,
2226 #[serde(skip_serializing_if = "Option::is_none")]
2227 pub alias: Option<Identifier>,
2228}
2229
2230#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2232#[cfg_attr(feature = "bindings", derive(TS))]
2233pub struct RowFormat {
2234 pub delimited: bool,
2235 pub fields_terminated_by: Option<String>,
2236 pub collection_items_terminated_by: Option<String>,
2237 pub map_keys_terminated_by: Option<String>,
2238 pub lines_terminated_by: Option<String>,
2239 pub null_defined_as: Option<String>,
2240}
2241
2242#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2244#[cfg_attr(feature = "bindings", derive(TS))]
2245pub struct DirectoryInsert {
2246 pub local: bool,
2247 pub path: String,
2248 pub row_format: Option<RowFormat>,
2249 #[serde(default)]
2251 pub stored_as: Option<String>,
2252}
2253
2254#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2256#[cfg_attr(feature = "bindings", derive(TS))]
2257pub struct Insert {
2258 pub table: TableRef,
2259 pub columns: Vec<Identifier>,
2260 pub values: Vec<Vec<Expression>>,
2261 pub query: Option<Expression>,
2262 pub overwrite: bool,
2264 pub partition: Vec<(Identifier, Option<Expression>)>,
2266 #[serde(default)]
2268 pub directory: Option<DirectoryInsert>,
2269 #[serde(default)]
2271 pub returning: Vec<Expression>,
2272 #[serde(default)]
2274 pub output: Option<OutputClause>,
2275 #[serde(default)]
2277 pub on_conflict: Option<Box<Expression>>,
2278 #[serde(default)]
2280 pub leading_comments: Vec<String>,
2281 #[serde(default)]
2283 pub if_exists: bool,
2284 #[serde(default)]
2286 pub with: Option<With>,
2287 #[serde(default)]
2289 pub ignore: bool,
2290 #[serde(default)]
2292 pub source_alias: Option<Identifier>,
2293 #[serde(default)]
2295 pub alias: Option<Identifier>,
2296 #[serde(default)]
2298 pub alias_explicit_as: bool,
2299 #[serde(default)]
2301 pub default_values: bool,
2302 #[serde(default)]
2304 pub by_name: bool,
2305 #[serde(default, skip_serializing_if = "Option::is_none")]
2307 pub conflict_action: Option<String>,
2308 #[serde(default)]
2310 pub is_replace: bool,
2311 #[serde(default, skip_serializing_if = "Option::is_none")]
2313 pub hint: Option<Hint>,
2314 #[serde(default)]
2316 pub replace_where: Option<Box<Expression>>,
2317 #[serde(default)]
2319 pub source: Option<Box<Expression>>,
2320 #[serde(default, skip_serializing_if = "Option::is_none")]
2322 pub function_target: Option<Box<Expression>>,
2323 #[serde(default, skip_serializing_if = "Option::is_none")]
2325 pub partition_by: Option<Box<Expression>>,
2326 #[serde(default, skip_serializing_if = "Vec::is_empty")]
2328 pub settings: Vec<Expression>,
2329}
2330
2331#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2333#[cfg_attr(feature = "bindings", derive(TS))]
2334pub struct OutputClause {
2335 pub columns: Vec<Expression>,
2337 #[serde(default)]
2339 pub into_table: Option<Expression>,
2340}
2341
2342#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2344#[cfg_attr(feature = "bindings", derive(TS))]
2345pub struct Update {
2346 pub table: TableRef,
2347 #[serde(default)]
2349 pub extra_tables: Vec<TableRef>,
2350 #[serde(default)]
2352 pub table_joins: Vec<Join>,
2353 pub set: Vec<(Identifier, Expression)>,
2354 pub from_clause: Option<From>,
2355 #[serde(default)]
2357 pub from_joins: Vec<Join>,
2358 pub where_clause: Option<Where>,
2359 #[serde(default)]
2361 pub returning: Vec<Expression>,
2362 #[serde(default)]
2364 pub output: Option<OutputClause>,
2365 #[serde(default)]
2367 pub with: Option<With>,
2368 #[serde(default)]
2370 pub leading_comments: Vec<String>,
2371 #[serde(default)]
2373 pub limit: Option<Expression>,
2374 #[serde(default)]
2376 pub order_by: Option<OrderBy>,
2377 #[serde(default)]
2379 pub from_before_set: bool,
2380}
2381
2382#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2384#[cfg_attr(feature = "bindings", derive(TS))]
2385pub struct Delete {
2386 pub table: TableRef,
2387 #[serde(default, skip_serializing_if = "Option::is_none")]
2389 pub on_cluster: Option<OnCluster>,
2390 pub alias: Option<Identifier>,
2392 #[serde(default)]
2394 pub alias_explicit_as: bool,
2395 pub using: Vec<TableRef>,
2397 pub where_clause: Option<Where>,
2398 #[serde(default)]
2400 pub output: Option<OutputClause>,
2401 #[serde(default)]
2403 pub leading_comments: Vec<String>,
2404 #[serde(default)]
2406 pub with: Option<With>,
2407 #[serde(default)]
2409 pub limit: Option<Expression>,
2410 #[serde(default)]
2412 pub order_by: Option<OrderBy>,
2413 #[serde(default)]
2415 pub returning: Vec<Expression>,
2416 #[serde(default)]
2419 pub tables: Vec<TableRef>,
2420 #[serde(default)]
2423 pub tables_from_using: bool,
2424 #[serde(default)]
2426 pub joins: Vec<Join>,
2427 #[serde(default)]
2429 pub force_index: Option<String>,
2430 #[serde(default)]
2432 pub no_from: bool,
2433}
2434
2435#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2437#[cfg_attr(feature = "bindings", derive(TS))]
2438pub struct CopyStmt {
2439 pub this: Expression,
2441 pub kind: bool,
2443 pub files: Vec<Expression>,
2445 #[serde(default)]
2447 pub params: Vec<CopyParameter>,
2448 #[serde(default)]
2450 pub credentials: Option<Box<Credentials>>,
2451 #[serde(default)]
2453 pub is_into: bool,
2454 #[serde(default)]
2456 pub with_wrapped: bool,
2457}
2458
2459#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2461#[cfg_attr(feature = "bindings", derive(TS))]
2462pub struct CopyParameter {
2463 pub name: String,
2464 pub value: Option<Expression>,
2465 pub values: Vec<Expression>,
2466 #[serde(default)]
2468 pub eq: bool,
2469}
2470
2471#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2473#[cfg_attr(feature = "bindings", derive(TS))]
2474pub struct Credentials {
2475 pub credentials: Vec<(String, String)>,
2476 pub encryption: Option<String>,
2477 pub storage: Option<String>,
2478}
2479
2480#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2482#[cfg_attr(feature = "bindings", derive(TS))]
2483pub struct PutStmt {
2484 pub source: String,
2486 #[serde(default)]
2488 pub source_quoted: bool,
2489 pub target: Expression,
2491 #[serde(default)]
2493 pub params: Vec<CopyParameter>,
2494}
2495
2496#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2498#[cfg_attr(feature = "bindings", derive(TS))]
2499pub struct StageReference {
2500 pub name: String,
2502 #[serde(default)]
2504 pub path: Option<String>,
2505 #[serde(default)]
2507 pub file_format: Option<Expression>,
2508 #[serde(default)]
2510 pub pattern: Option<String>,
2511 #[serde(default, skip_serializing_if = "std::ops::Not::not")]
2513 pub quoted: bool,
2514}
2515
2516#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2518#[cfg_attr(feature = "bindings", derive(TS))]
2519pub struct HistoricalData {
2520 pub this: Box<Expression>,
2522 pub kind: String,
2524 pub expression: Box<Expression>,
2526}
2527
2528#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2533#[cfg_attr(feature = "bindings", derive(TS))]
2534pub struct Alias {
2535 pub this: Expression,
2537 pub alias: Identifier,
2539 #[serde(default)]
2541 pub column_aliases: Vec<Identifier>,
2542 #[serde(default)]
2544 pub pre_alias_comments: Vec<String>,
2545 #[serde(default)]
2547 pub trailing_comments: Vec<String>,
2548}
2549
2550impl Alias {
2551 pub fn new(this: Expression, alias: Identifier) -> Self {
2553 Self {
2554 this,
2555 alias,
2556 column_aliases: Vec::new(),
2557 pre_alias_comments: Vec::new(),
2558 trailing_comments: Vec::new(),
2559 }
2560 }
2561
2562 pub fn with_columns(this: Expression, column_aliases: Vec<Identifier>) -> Self {
2564 Self {
2565 this,
2566 alias: Identifier::empty(),
2567 column_aliases,
2568 pre_alias_comments: Vec::new(),
2569 trailing_comments: Vec::new(),
2570 }
2571 }
2572}
2573
2574#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2581#[cfg_attr(feature = "bindings", derive(TS))]
2582pub struct Cast {
2583 pub this: Expression,
2585 pub to: DataType,
2587 #[serde(default)]
2588 pub trailing_comments: Vec<String>,
2589 #[serde(default)]
2591 pub double_colon_syntax: bool,
2592 #[serde(skip_serializing_if = "Option::is_none", default)]
2594 pub format: Option<Box<Expression>>,
2595 #[serde(skip_serializing_if = "Option::is_none", default)]
2597 pub default: Option<Box<Expression>>,
2598}
2599
2600#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2602#[cfg_attr(feature = "bindings", derive(TS))]
2603pub struct CollationExpr {
2604 pub this: Expression,
2605 pub collation: String,
2606 #[serde(default)]
2608 pub quoted: bool,
2609 #[serde(default)]
2611 pub double_quoted: bool,
2612}
2613
2614#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2620#[cfg_attr(feature = "bindings", derive(TS))]
2621pub struct Case {
2622 pub operand: Option<Expression>,
2624 pub whens: Vec<(Expression, Expression)>,
2626 pub else_: Option<Expression>,
2628 #[serde(default)]
2630 #[serde(skip_serializing_if = "Vec::is_empty")]
2631 pub comments: Vec<String>,
2632}
2633
2634#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2642#[cfg_attr(feature = "bindings", derive(TS))]
2643pub struct BinaryOp {
2644 pub left: Expression,
2645 pub right: Expression,
2646 #[serde(default)]
2648 pub left_comments: Vec<String>,
2649 #[serde(default)]
2651 pub operator_comments: Vec<String>,
2652 #[serde(default)]
2654 pub trailing_comments: Vec<String>,
2655}
2656
2657impl BinaryOp {
2658 pub fn new(left: Expression, right: Expression) -> Self {
2659 Self {
2660 left,
2661 right,
2662 left_comments: Vec::new(),
2663 operator_comments: Vec::new(),
2664 trailing_comments: Vec::new(),
2665 }
2666 }
2667}
2668
2669#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2671#[cfg_attr(feature = "bindings", derive(TS))]
2672pub struct LikeOp {
2673 pub left: Expression,
2674 pub right: Expression,
2675 #[serde(default)]
2677 pub escape: Option<Expression>,
2678 #[serde(default)]
2680 pub quantifier: Option<String>,
2681}
2682
2683impl LikeOp {
2684 pub fn new(left: Expression, right: Expression) -> Self {
2685 Self {
2686 left,
2687 right,
2688 escape: None,
2689 quantifier: None,
2690 }
2691 }
2692
2693 pub fn with_escape(left: Expression, right: Expression, escape: Expression) -> Self {
2694 Self {
2695 left,
2696 right,
2697 escape: Some(escape),
2698 quantifier: None,
2699 }
2700 }
2701}
2702
2703#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2707#[cfg_attr(feature = "bindings", derive(TS))]
2708pub struct UnaryOp {
2709 pub this: Expression,
2711}
2712
2713impl UnaryOp {
2714 pub fn new(this: Expression) -> Self {
2715 Self { this }
2716 }
2717}
2718
2719#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2724#[cfg_attr(feature = "bindings", derive(TS))]
2725pub struct In {
2726 pub this: Expression,
2728 pub expressions: Vec<Expression>,
2730 pub query: Option<Expression>,
2732 pub not: bool,
2734 #[serde(default, skip_serializing_if = "std::ops::Not::not")]
2735 pub global: bool,
2736 #[serde(default, skip_serializing_if = "Option::is_none")]
2738 pub unnest: Option<Box<Expression>>,
2739 #[serde(default, skip_serializing_if = "std::ops::Not::not")]
2743 pub is_field: bool,
2744}
2745
2746#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2748#[cfg_attr(feature = "bindings", derive(TS))]
2749pub struct Between {
2750 pub this: Expression,
2752 pub low: Expression,
2754 pub high: Expression,
2756 pub not: bool,
2758 #[serde(default)]
2760 pub symmetric: Option<bool>,
2761}
2762
2763#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2765#[cfg_attr(feature = "bindings", derive(TS))]
2766pub struct IsNull {
2767 pub this: Expression,
2768 pub not: bool,
2769 #[serde(default)]
2771 pub postfix_form: bool,
2772}
2773
2774#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2776#[cfg_attr(feature = "bindings", derive(TS))]
2777pub struct IsTrueFalse {
2778 pub this: Expression,
2779 pub not: bool,
2780}
2781
2782#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2785#[cfg_attr(feature = "bindings", derive(TS))]
2786pub struct IsJson {
2787 pub this: Expression,
2788 pub json_type: Option<String>,
2790 pub unique_keys: Option<JsonUniqueKeys>,
2792 pub negated: bool,
2794}
2795
2796#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2798#[cfg_attr(feature = "bindings", derive(TS))]
2799pub enum JsonUniqueKeys {
2800 With,
2802 Without,
2804 Shorthand,
2806}
2807
2808#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2810#[cfg_attr(feature = "bindings", derive(TS))]
2811pub struct Exists {
2812 pub this: Expression,
2814 pub not: bool,
2816}
2817
2818#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2825#[cfg_attr(feature = "bindings", derive(TS))]
2826pub struct Function {
2827 pub name: String,
2829 pub args: Vec<Expression>,
2831 pub distinct: bool,
2833 #[serde(default)]
2834 pub trailing_comments: Vec<String>,
2835 #[serde(default)]
2837 pub use_bracket_syntax: bool,
2838 #[serde(default)]
2840 pub no_parens: bool,
2841 #[serde(default)]
2843 pub quoted: bool,
2844}
2845
2846impl Default for Function {
2847 fn default() -> Self {
2848 Self {
2849 name: String::new(),
2850 args: Vec::new(),
2851 distinct: false,
2852 trailing_comments: Vec::new(),
2853 use_bracket_syntax: false,
2854 no_parens: false,
2855 quoted: false,
2856 }
2857 }
2858}
2859
2860impl Function {
2861 pub fn new(name: impl Into<String>, args: Vec<Expression>) -> Self {
2862 Self {
2863 name: name.into(),
2864 args,
2865 distinct: false,
2866 trailing_comments: Vec::new(),
2867 use_bracket_syntax: false,
2868 no_parens: false,
2869 quoted: false,
2870 }
2871 }
2872}
2873
2874#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2881#[cfg_attr(feature = "bindings", derive(TS))]
2882pub struct AggregateFunction {
2883 pub name: String,
2885 pub args: Vec<Expression>,
2887 pub distinct: bool,
2889 pub filter: Option<Expression>,
2891 #[serde(default, skip_serializing_if = "Vec::is_empty")]
2893 pub order_by: Vec<Ordered>,
2894 #[serde(default, skip_serializing_if = "Option::is_none")]
2896 pub limit: Option<Box<Expression>>,
2897 #[serde(default, skip_serializing_if = "Option::is_none")]
2899 pub ignore_nulls: Option<bool>,
2900}
2901
2902#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2909#[cfg_attr(feature = "bindings", derive(TS))]
2910pub struct WindowFunction {
2911 pub this: Expression,
2913 pub over: Over,
2915 #[serde(default, skip_serializing_if = "Option::is_none")]
2917 pub keep: Option<Keep>,
2918}
2919
2920#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2923#[cfg_attr(feature = "bindings", derive(TS))]
2924pub struct Keep {
2925 pub first: bool,
2927 pub order_by: Vec<Ordered>,
2929}
2930
2931#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2933#[cfg_attr(feature = "bindings", derive(TS))]
2934pub struct WithinGroup {
2935 pub this: Expression,
2937 pub order_by: Vec<Ordered>,
2939}
2940
2941#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2946#[cfg_attr(feature = "bindings", derive(TS))]
2947pub struct From {
2948 pub expressions: Vec<Expression>,
2950}
2951
2952#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2958#[cfg_attr(feature = "bindings", derive(TS))]
2959pub struct Join {
2960 pub this: Expression,
2962 pub on: Option<Expression>,
2964 pub using: Vec<Identifier>,
2966 pub kind: JoinKind,
2968 pub use_inner_keyword: bool,
2970 pub use_outer_keyword: bool,
2972 pub deferred_condition: bool,
2974 #[serde(default, skip_serializing_if = "Option::is_none")]
2976 pub join_hint: Option<String>,
2977 #[serde(default, skip_serializing_if = "Option::is_none")]
2979 pub match_condition: Option<Expression>,
2980 #[serde(default, skip_serializing_if = "Vec::is_empty")]
2982 pub pivots: Vec<Expression>,
2983 #[serde(default, skip_serializing_if = "Vec::is_empty")]
2985 pub comments: Vec<String>,
2986 #[serde(default)]
2990 pub nesting_group: usize,
2991 #[serde(default)]
2993 pub directed: bool,
2994}
2995
2996#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
3003#[cfg_attr(feature = "bindings", derive(TS))]
3004pub enum JoinKind {
3005 Inner,
3006 Left,
3007 Right,
3008 Full,
3009 Outer, Cross,
3011 Natural,
3012 NaturalLeft,
3013 NaturalRight,
3014 NaturalFull,
3015 Semi,
3016 Anti,
3017 LeftSemi,
3019 LeftAnti,
3020 RightSemi,
3021 RightAnti,
3022 CrossApply,
3024 OuterApply,
3025 AsOf,
3027 AsOfLeft,
3028 AsOfRight,
3029 Lateral,
3031 LeftLateral,
3032 Straight,
3034 Implicit,
3036 Array,
3038 LeftArray,
3039 Paste,
3041}
3042
3043impl Default for JoinKind {
3044 fn default() -> Self {
3045 JoinKind::Inner
3046 }
3047}
3048
3049#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3052#[cfg_attr(feature = "bindings", derive(TS))]
3053pub struct JoinedTable {
3054 pub left: Expression,
3056 pub joins: Vec<Join>,
3058 pub lateral_views: Vec<LateralView>,
3060 pub alias: Option<Identifier>,
3062}
3063
3064#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3066#[cfg_attr(feature = "bindings", derive(TS))]
3067pub struct Where {
3068 pub this: Expression,
3070}
3071
3072#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3077#[cfg_attr(feature = "bindings", derive(TS))]
3078pub struct GroupBy {
3079 pub expressions: Vec<Expression>,
3081 #[serde(default)]
3083 pub all: Option<bool>,
3084 #[serde(default)]
3086 pub totals: bool,
3087 #[serde(default, skip_serializing_if = "Vec::is_empty")]
3089 pub comments: Vec<String>,
3090}
3091
3092#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3094#[cfg_attr(feature = "bindings", derive(TS))]
3095pub struct Having {
3096 pub this: Expression,
3098 #[serde(default, skip_serializing_if = "Vec::is_empty")]
3100 pub comments: Vec<String>,
3101}
3102
3103#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3105#[cfg_attr(feature = "bindings", derive(TS))]
3106pub struct OrderBy {
3107 pub expressions: Vec<Ordered>,
3109 #[serde(default, skip_serializing_if = "std::ops::Not::not")]
3111 pub siblings: bool,
3112 #[serde(default, skip_serializing_if = "Vec::is_empty")]
3114 pub comments: Vec<String>,
3115}
3116
3117#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3124#[cfg_attr(feature = "bindings", derive(TS))]
3125pub struct Ordered {
3126 pub this: Expression,
3128 pub desc: bool,
3130 pub nulls_first: Option<bool>,
3132 #[serde(default)]
3134 pub explicit_asc: bool,
3135 #[serde(default, skip_serializing_if = "Option::is_none")]
3137 pub with_fill: Option<Box<WithFill>>,
3138}
3139
3140impl Ordered {
3141 pub fn asc(expr: Expression) -> Self {
3142 Self {
3143 this: expr,
3144 desc: false,
3145 nulls_first: None,
3146 explicit_asc: false,
3147 with_fill: None,
3148 }
3149 }
3150
3151 pub fn desc(expr: Expression) -> Self {
3152 Self {
3153 this: expr,
3154 desc: true,
3155 nulls_first: None,
3156 explicit_asc: false,
3157 with_fill: None,
3158 }
3159 }
3160}
3161
3162#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3165#[cfg_attr(feature = "bindings", derive(TS))]
3166#[cfg_attr(feature = "bindings", ts(export))]
3167pub struct DistributeBy {
3168 pub expressions: Vec<Expression>,
3169}
3170
3171#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3174#[cfg_attr(feature = "bindings", derive(TS))]
3175#[cfg_attr(feature = "bindings", ts(export))]
3176pub struct ClusterBy {
3177 pub expressions: Vec<Ordered>,
3178}
3179
3180#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3183#[cfg_attr(feature = "bindings", derive(TS))]
3184#[cfg_attr(feature = "bindings", ts(export))]
3185pub struct SortBy {
3186 pub expressions: Vec<Ordered>,
3187}
3188
3189#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3192#[cfg_attr(feature = "bindings", derive(TS))]
3193#[cfg_attr(feature = "bindings", ts(export))]
3194pub struct LateralView {
3195 pub this: Expression,
3197 pub table_alias: Option<Identifier>,
3199 pub column_aliases: Vec<Identifier>,
3201 pub outer: bool,
3203}
3204
3205#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3207#[cfg_attr(feature = "bindings", derive(TS))]
3208#[cfg_attr(feature = "bindings", ts(export))]
3209pub struct Hint {
3210 pub expressions: Vec<HintExpression>,
3211}
3212
3213#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3215#[cfg_attr(feature = "bindings", derive(TS))]
3216#[cfg_attr(feature = "bindings", ts(export))]
3217pub enum HintExpression {
3218 Function { name: String, args: Vec<Expression> },
3220 Identifier(String),
3222 Raw(String),
3224}
3225
3226#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
3228#[cfg_attr(feature = "bindings", derive(TS))]
3229#[cfg_attr(feature = "bindings", ts(export))]
3230pub enum PseudocolumnType {
3231 Rownum, Rowid, Level, Sysdate, ObjectId, ObjectValue, }
3238
3239impl PseudocolumnType {
3240 pub fn as_str(&self) -> &'static str {
3241 match self {
3242 PseudocolumnType::Rownum => "ROWNUM",
3243 PseudocolumnType::Rowid => "ROWID",
3244 PseudocolumnType::Level => "LEVEL",
3245 PseudocolumnType::Sysdate => "SYSDATE",
3246 PseudocolumnType::ObjectId => "OBJECT_ID",
3247 PseudocolumnType::ObjectValue => "OBJECT_VALUE",
3248 }
3249 }
3250
3251 pub fn from_str(s: &str) -> Option<Self> {
3252 match s.to_uppercase().as_str() {
3253 "ROWNUM" => Some(PseudocolumnType::Rownum),
3254 "ROWID" => Some(PseudocolumnType::Rowid),
3255 "LEVEL" => Some(PseudocolumnType::Level),
3256 "SYSDATE" => Some(PseudocolumnType::Sysdate),
3257 "OBJECT_ID" => Some(PseudocolumnType::ObjectId),
3258 "OBJECT_VALUE" => Some(PseudocolumnType::ObjectValue),
3259 _ => None,
3260 }
3261 }
3262}
3263
3264#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3267#[cfg_attr(feature = "bindings", derive(TS))]
3268#[cfg_attr(feature = "bindings", ts(export))]
3269pub struct Pseudocolumn {
3270 pub kind: PseudocolumnType,
3271}
3272
3273impl Pseudocolumn {
3274 pub fn rownum() -> Self {
3275 Self {
3276 kind: PseudocolumnType::Rownum,
3277 }
3278 }
3279
3280 pub fn rowid() -> Self {
3281 Self {
3282 kind: PseudocolumnType::Rowid,
3283 }
3284 }
3285
3286 pub fn level() -> Self {
3287 Self {
3288 kind: PseudocolumnType::Level,
3289 }
3290 }
3291}
3292
3293#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3295#[cfg_attr(feature = "bindings", derive(TS))]
3296#[cfg_attr(feature = "bindings", ts(export))]
3297pub struct Connect {
3298 pub start: Option<Expression>,
3300 pub connect: Expression,
3302 pub nocycle: bool,
3304}
3305
3306#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3308#[cfg_attr(feature = "bindings", derive(TS))]
3309#[cfg_attr(feature = "bindings", ts(export))]
3310pub struct Prior {
3311 pub this: Expression,
3312}
3313
3314#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3316#[cfg_attr(feature = "bindings", derive(TS))]
3317#[cfg_attr(feature = "bindings", ts(export))]
3318pub struct ConnectByRoot {
3319 pub this: Expression,
3320}
3321
3322#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3324#[cfg_attr(feature = "bindings", derive(TS))]
3325#[cfg_attr(feature = "bindings", ts(export))]
3326pub struct MatchRecognize {
3327 pub this: Option<Box<Expression>>,
3329 pub partition_by: Option<Vec<Expression>>,
3331 pub order_by: Option<Vec<Ordered>>,
3333 pub measures: Option<Vec<MatchRecognizeMeasure>>,
3335 pub rows: Option<MatchRecognizeRows>,
3337 pub after: Option<MatchRecognizeAfter>,
3339 pub pattern: Option<String>,
3341 pub define: Option<Vec<(Identifier, Expression)>>,
3343 pub alias: Option<Identifier>,
3345 #[serde(default, skip_serializing_if = "std::ops::Not::not")]
3347 pub alias_explicit_as: bool,
3348}
3349
3350#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3352#[cfg_attr(feature = "bindings", derive(TS))]
3353#[cfg_attr(feature = "bindings", ts(export))]
3354pub struct MatchRecognizeMeasure {
3355 pub this: Expression,
3357 pub window_frame: Option<MatchRecognizeSemantics>,
3359}
3360
3361#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
3363#[cfg_attr(feature = "bindings", derive(TS))]
3364#[cfg_attr(feature = "bindings", ts(export))]
3365pub enum MatchRecognizeSemantics {
3366 Running,
3367 Final,
3368}
3369
3370#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
3372#[cfg_attr(feature = "bindings", derive(TS))]
3373#[cfg_attr(feature = "bindings", ts(export))]
3374pub enum MatchRecognizeRows {
3375 OneRowPerMatch,
3376 AllRowsPerMatch,
3377 AllRowsPerMatchShowEmptyMatches,
3378 AllRowsPerMatchOmitEmptyMatches,
3379 AllRowsPerMatchWithUnmatchedRows,
3380}
3381
3382#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3384#[cfg_attr(feature = "bindings", derive(TS))]
3385#[cfg_attr(feature = "bindings", ts(export))]
3386pub enum MatchRecognizeAfter {
3387 PastLastRow,
3388 ToNextRow,
3389 ToFirst(Identifier),
3390 ToLast(Identifier),
3391}
3392
3393#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3395#[cfg_attr(feature = "bindings", derive(TS))]
3396pub struct Limit {
3397 pub this: Expression,
3399 #[serde(default, skip_serializing_if = "std::ops::Not::not")]
3401 pub percent: bool,
3402 #[serde(default)]
3404 #[serde(skip_serializing_if = "Vec::is_empty")]
3405 pub comments: Vec<String>,
3406}
3407
3408#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3410#[cfg_attr(feature = "bindings", derive(TS))]
3411pub struct Offset {
3412 pub this: Expression,
3413 #[serde(skip_serializing_if = "Option::is_none", default)]
3415 pub rows: Option<bool>,
3416}
3417
3418#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3420#[cfg_attr(feature = "bindings", derive(TS))]
3421pub struct Top {
3422 pub this: Expression,
3423 pub percent: bool,
3424 pub with_ties: bool,
3425 #[serde(default)]
3427 pub parenthesized: bool,
3428}
3429
3430#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3432#[cfg_attr(feature = "bindings", derive(TS))]
3433pub struct Fetch {
3434 pub direction: String,
3436 pub count: Option<Expression>,
3438 pub percent: bool,
3440 pub rows: bool,
3442 pub with_ties: bool,
3444}
3445
3446#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3452#[cfg_attr(feature = "bindings", derive(TS))]
3453pub struct Qualify {
3454 pub this: Expression,
3456}
3457
3458#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3460#[cfg_attr(feature = "bindings", derive(TS))]
3461pub struct Sample {
3462 pub method: SampleMethod,
3463 pub size: Expression,
3464 pub seed: Option<Expression>,
3465 #[serde(default)]
3467 pub offset: Option<Expression>,
3468 pub unit_after_size: bool,
3470 #[serde(default)]
3472 pub use_sample_keyword: bool,
3473 #[serde(default)]
3475 pub explicit_method: bool,
3476 #[serde(default)]
3478 pub method_before_size: bool,
3479 #[serde(default)]
3481 pub use_seed_keyword: bool,
3482 pub bucket_numerator: Option<Box<Expression>>,
3484 pub bucket_denominator: Option<Box<Expression>>,
3486 pub bucket_field: Option<Box<Expression>>,
3488 #[serde(default)]
3490 pub is_using_sample: bool,
3491 #[serde(default)]
3493 pub is_percent: bool,
3494 #[serde(default)]
3496 pub suppress_method_output: bool,
3497}
3498
3499#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
3501#[cfg_attr(feature = "bindings", derive(TS))]
3502pub enum SampleMethod {
3503 Bernoulli,
3504 System,
3505 Block,
3506 Row,
3507 Percent,
3508 Bucket,
3510 Reservoir,
3512}
3513
3514#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3516#[cfg_attr(feature = "bindings", derive(TS))]
3517pub struct NamedWindow {
3518 pub name: Identifier,
3519 pub spec: Over,
3520}
3521
3522#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3528#[cfg_attr(feature = "bindings", derive(TS))]
3529pub struct With {
3530 pub ctes: Vec<Cte>,
3532 pub recursive: bool,
3534 #[serde(default)]
3536 pub leading_comments: Vec<String>,
3537 #[serde(default, skip_serializing_if = "Option::is_none")]
3539 pub search: Option<Box<Expression>>,
3540}
3541
3542#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3549#[cfg_attr(feature = "bindings", derive(TS))]
3550pub struct Cte {
3551 pub alias: Identifier,
3553 pub this: Expression,
3555 pub columns: Vec<Identifier>,
3557 pub materialized: Option<bool>,
3559 #[serde(default, skip_serializing_if = "Vec::is_empty")]
3561 pub key_expressions: Vec<Identifier>,
3562 #[serde(default)]
3564 pub alias_first: bool,
3565 #[serde(default, skip_serializing_if = "Vec::is_empty")]
3567 pub comments: Vec<String>,
3568}
3569
3570#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3572#[cfg_attr(feature = "bindings", derive(TS))]
3573pub struct WindowSpec {
3574 pub partition_by: Vec<Expression>,
3575 pub order_by: Vec<Ordered>,
3576 pub frame: Option<WindowFrame>,
3577}
3578
3579#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3581#[cfg_attr(feature = "bindings", derive(TS))]
3582pub struct Over {
3583 pub window_name: Option<Identifier>,
3585 pub partition_by: Vec<Expression>,
3586 pub order_by: Vec<Ordered>,
3587 pub frame: Option<WindowFrame>,
3588 pub alias: Option<Identifier>,
3589}
3590
3591#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3593#[cfg_attr(feature = "bindings", derive(TS))]
3594pub struct WindowFrame {
3595 pub kind: WindowFrameKind,
3596 pub start: WindowFrameBound,
3597 pub end: Option<WindowFrameBound>,
3598 pub exclude: Option<WindowFrameExclude>,
3599 #[serde(default, skip_serializing_if = "Option::is_none")]
3601 pub kind_text: Option<String>,
3602 #[serde(default, skip_serializing_if = "Option::is_none")]
3604 pub start_side_text: Option<String>,
3605 #[serde(default, skip_serializing_if = "Option::is_none")]
3607 pub end_side_text: Option<String>,
3608}
3609
3610#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
3611#[cfg_attr(feature = "bindings", derive(TS))]
3612pub enum WindowFrameKind {
3613 Rows,
3614 Range,
3615 Groups,
3616}
3617
3618#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
3620#[cfg_attr(feature = "bindings", derive(TS))]
3621pub enum WindowFrameExclude {
3622 CurrentRow,
3623 Group,
3624 Ties,
3625 NoOthers,
3626}
3627
3628#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3629#[cfg_attr(feature = "bindings", derive(TS))]
3630pub enum WindowFrameBound {
3631 CurrentRow,
3632 UnboundedPreceding,
3633 UnboundedFollowing,
3634 Preceding(Box<Expression>),
3635 Following(Box<Expression>),
3636 BarePreceding,
3638 BareFollowing,
3640 Value(Box<Expression>),
3642}
3643
3644#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3646#[cfg_attr(feature = "bindings", derive(TS))]
3647pub struct StructField {
3648 pub name: String,
3649 pub data_type: DataType,
3650 #[serde(default, skip_serializing_if = "Vec::is_empty")]
3651 pub options: Vec<Expression>,
3652 #[serde(default, skip_serializing_if = "Option::is_none")]
3653 pub comment: Option<String>,
3654}
3655
3656impl StructField {
3657 pub fn new(name: String, data_type: DataType) -> Self {
3659 Self {
3660 name,
3661 data_type,
3662 options: Vec::new(),
3663 comment: None,
3664 }
3665 }
3666
3667 pub fn with_options(name: String, data_type: DataType, options: Vec<Expression>) -> Self {
3669 Self {
3670 name,
3671 data_type,
3672 options,
3673 comment: None,
3674 }
3675 }
3676
3677 pub fn with_options_and_comment(
3679 name: String,
3680 data_type: DataType,
3681 options: Vec<Expression>,
3682 comment: Option<String>,
3683 ) -> Self {
3684 Self {
3685 name,
3686 data_type,
3687 options,
3688 comment,
3689 }
3690 }
3691}
3692
3693#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3705#[cfg_attr(feature = "bindings", derive(TS))]
3706#[serde(tag = "data_type", rename_all = "snake_case")]
3707pub enum DataType {
3708 Boolean,
3710 TinyInt {
3711 length: Option<u32>,
3712 },
3713 SmallInt {
3714 length: Option<u32>,
3715 },
3716 Int {
3720 length: Option<u32>,
3721 #[serde(default, skip_serializing_if = "std::ops::Not::not")]
3722 integer_spelling: bool,
3723 },
3724 BigInt {
3725 length: Option<u32>,
3726 },
3727 Float {
3731 precision: Option<u32>,
3732 scale: Option<u32>,
3733 #[serde(default, skip_serializing_if = "std::ops::Not::not")]
3734 real_spelling: bool,
3735 },
3736 Double {
3737 precision: Option<u32>,
3738 scale: Option<u32>,
3739 },
3740 Decimal {
3741 precision: Option<u32>,
3742 scale: Option<u32>,
3743 },
3744
3745 Char {
3747 length: Option<u32>,
3748 },
3749 VarChar {
3752 length: Option<u32>,
3753 #[serde(default, skip_serializing_if = "std::ops::Not::not")]
3754 parenthesized_length: bool,
3755 },
3756 String {
3758 length: Option<u32>,
3759 },
3760 Text,
3761 #[serde(alias = "TextWithLength")]
3763 TextWithLength {
3764 length: u32,
3765 },
3766
3767 Binary {
3769 length: Option<u32>,
3770 },
3771 VarBinary {
3772 length: Option<u32>,
3773 },
3774 Blob,
3775
3776 Bit {
3778 length: Option<u32>,
3779 },
3780 VarBit {
3781 length: Option<u32>,
3782 },
3783
3784 Date,
3786 Time {
3787 precision: Option<u32>,
3788 #[serde(default)]
3789 timezone: bool,
3790 },
3791 Timestamp {
3792 precision: Option<u32>,
3793 timezone: bool,
3794 },
3795 Interval {
3796 unit: Option<String>,
3797 #[serde(default, skip_serializing_if = "Option::is_none")]
3799 to: Option<String>,
3800 },
3801
3802 Json,
3804 JsonB,
3805
3806 Uuid,
3808
3809 Array {
3811 element_type: Box<DataType>,
3812 #[serde(default, skip_serializing_if = "Option::is_none")]
3814 dimension: Option<u32>,
3815 },
3816
3817 List {
3820 element_type: Box<DataType>,
3821 },
3822
3823 Struct {
3827 fields: Vec<StructField>,
3828 nested: bool,
3829 },
3830 Map {
3831 key_type: Box<DataType>,
3832 value_type: Box<DataType>,
3833 },
3834
3835 Enum {
3837 values: Vec<String>,
3838 #[serde(default, skip_serializing_if = "Vec::is_empty")]
3839 assignments: Vec<Option<String>>,
3840 },
3841
3842 Set {
3844 values: Vec<String>,
3845 },
3846
3847 Union {
3849 fields: Vec<(String, DataType)>,
3850 },
3851
3852 Vector {
3854 #[serde(default)]
3855 element_type: Option<Box<DataType>>,
3856 dimension: Option<u32>,
3857 },
3858
3859 Object {
3862 fields: Vec<(String, DataType, bool)>,
3863 modifier: Option<String>,
3864 },
3865
3866 Nullable {
3868 inner: Box<DataType>,
3869 },
3870
3871 Custom {
3873 name: String,
3874 },
3875
3876 Geometry {
3878 subtype: Option<String>,
3879 srid: Option<u32>,
3880 },
3881 Geography {
3882 subtype: Option<String>,
3883 srid: Option<u32>,
3884 },
3885
3886 CharacterSet {
3889 name: String,
3890 },
3891
3892 Unknown,
3894}
3895
3896#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3898#[cfg_attr(feature = "bindings", derive(TS))]
3899#[cfg_attr(feature = "bindings", ts(rename = "SqlArray"))]
3900pub struct Array {
3901 pub expressions: Vec<Expression>,
3902}
3903
3904#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3906#[cfg_attr(feature = "bindings", derive(TS))]
3907pub struct Struct {
3908 pub fields: Vec<(Option<String>, Expression)>,
3909}
3910
3911#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3913#[cfg_attr(feature = "bindings", derive(TS))]
3914pub struct Tuple {
3915 pub expressions: Vec<Expression>,
3916}
3917
3918#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3920#[cfg_attr(feature = "bindings", derive(TS))]
3921pub struct Interval {
3922 pub this: Option<Expression>,
3924 pub unit: Option<IntervalUnitSpec>,
3926}
3927
3928#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3930#[cfg_attr(feature = "bindings", derive(TS))]
3931#[serde(tag = "type", rename_all = "snake_case")]
3932pub enum IntervalUnitSpec {
3933 Simple {
3935 unit: IntervalUnit,
3936 use_plural: bool,
3938 },
3939 Span(IntervalSpan),
3941 ExprSpan(IntervalSpanExpr),
3944 Expr(Box<Expression>),
3946}
3947
3948#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3950#[cfg_attr(feature = "bindings", derive(TS))]
3951pub struct IntervalSpan {
3952 pub this: IntervalUnit,
3954 pub expression: IntervalUnit,
3956}
3957
3958#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3961#[cfg_attr(feature = "bindings", derive(TS))]
3962pub struct IntervalSpanExpr {
3963 pub this: Box<Expression>,
3965 pub expression: Box<Expression>,
3967}
3968
3969#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
3970#[cfg_attr(feature = "bindings", derive(TS))]
3971pub enum IntervalUnit {
3972 Year,
3973 Quarter,
3974 Month,
3975 Week,
3976 Day,
3977 Hour,
3978 Minute,
3979 Second,
3980 Millisecond,
3981 Microsecond,
3982 Nanosecond,
3983}
3984
3985#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3987#[cfg_attr(feature = "bindings", derive(TS))]
3988pub struct Command {
3989 pub this: String,
3991}
3992
3993#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3996#[cfg_attr(feature = "bindings", derive(TS))]
3997pub struct ExecuteStatement {
3998 pub this: Expression,
4000 #[serde(default)]
4002 pub parameters: Vec<ExecuteParameter>,
4003}
4004
4005#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4007#[cfg_attr(feature = "bindings", derive(TS))]
4008pub struct ExecuteParameter {
4009 pub name: String,
4011 pub value: Expression,
4013}
4014
4015#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4018#[cfg_attr(feature = "bindings", derive(TS))]
4019pub struct Kill {
4020 pub this: Expression,
4022 pub kind: Option<String>,
4024}
4025
4026#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4028#[cfg_attr(feature = "bindings", derive(TS))]
4029pub struct Raw {
4030 pub sql: String,
4031}
4032
4033#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4039#[cfg_attr(feature = "bindings", derive(TS))]
4040pub struct UnaryFunc {
4041 pub this: Expression,
4042 #[serde(skip_serializing_if = "Option::is_none", default)]
4044 pub original_name: Option<String>,
4045}
4046
4047impl UnaryFunc {
4048 pub fn new(this: Expression) -> Self {
4050 Self {
4051 this,
4052 original_name: None,
4053 }
4054 }
4055
4056 pub fn with_name(this: Expression, name: String) -> Self {
4058 Self {
4059 this,
4060 original_name: Some(name),
4061 }
4062 }
4063}
4064
4065#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4069#[cfg_attr(feature = "bindings", derive(TS))]
4070pub struct CharFunc {
4071 pub args: Vec<Expression>,
4072 #[serde(skip_serializing_if = "Option::is_none", default)]
4073 pub charset: Option<String>,
4074 #[serde(skip_serializing_if = "Option::is_none", default)]
4076 pub name: Option<String>,
4077}
4078
4079#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4081#[cfg_attr(feature = "bindings", derive(TS))]
4082pub struct BinaryFunc {
4083 pub this: Expression,
4084 pub expression: Expression,
4085 #[serde(skip_serializing_if = "Option::is_none", default)]
4087 pub original_name: Option<String>,
4088}
4089
4090#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4092#[cfg_attr(feature = "bindings", derive(TS))]
4093pub struct VarArgFunc {
4094 pub expressions: Vec<Expression>,
4095 #[serde(skip_serializing_if = "Option::is_none", default)]
4097 pub original_name: Option<String>,
4098}
4099
4100#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4102#[cfg_attr(feature = "bindings", derive(TS))]
4103pub struct ConcatWs {
4104 pub separator: Expression,
4105 pub expressions: Vec<Expression>,
4106}
4107
4108#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4110#[cfg_attr(feature = "bindings", derive(TS))]
4111pub struct SubstringFunc {
4112 pub this: Expression,
4113 pub start: Expression,
4114 pub length: Option<Expression>,
4115 #[serde(default)]
4117 pub from_for_syntax: bool,
4118}
4119
4120#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4122#[cfg_attr(feature = "bindings", derive(TS))]
4123pub struct OverlayFunc {
4124 pub this: Expression,
4125 pub replacement: Expression,
4126 pub from: Expression,
4127 pub length: Option<Expression>,
4128}
4129
4130#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4132#[cfg_attr(feature = "bindings", derive(TS))]
4133pub struct TrimFunc {
4134 pub this: Expression,
4135 pub characters: Option<Expression>,
4136 pub position: TrimPosition,
4137 #[serde(default)]
4139 pub sql_standard_syntax: bool,
4140 #[serde(default)]
4142 pub position_explicit: bool,
4143}
4144
4145#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
4146#[cfg_attr(feature = "bindings", derive(TS))]
4147pub enum TrimPosition {
4148 Both,
4149 Leading,
4150 Trailing,
4151}
4152
4153#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4155#[cfg_attr(feature = "bindings", derive(TS))]
4156pub struct ReplaceFunc {
4157 pub this: Expression,
4158 pub old: Expression,
4159 pub new: Expression,
4160}
4161
4162#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4164#[cfg_attr(feature = "bindings", derive(TS))]
4165pub struct LeftRightFunc {
4166 pub this: Expression,
4167 pub length: Expression,
4168}
4169
4170#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4172#[cfg_attr(feature = "bindings", derive(TS))]
4173pub struct RepeatFunc {
4174 pub this: Expression,
4175 pub times: Expression,
4176}
4177
4178#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4180#[cfg_attr(feature = "bindings", derive(TS))]
4181pub struct PadFunc {
4182 pub this: Expression,
4183 pub length: Expression,
4184 pub fill: Option<Expression>,
4185}
4186
4187#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4189#[cfg_attr(feature = "bindings", derive(TS))]
4190pub struct SplitFunc {
4191 pub this: Expression,
4192 pub delimiter: Expression,
4193}
4194
4195#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4197#[cfg_attr(feature = "bindings", derive(TS))]
4198pub struct RegexpFunc {
4199 pub this: Expression,
4200 pub pattern: Expression,
4201 pub flags: Option<Expression>,
4202}
4203
4204#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4206#[cfg_attr(feature = "bindings", derive(TS))]
4207pub struct RegexpReplaceFunc {
4208 pub this: Expression,
4209 pub pattern: Expression,
4210 pub replacement: Expression,
4211 pub flags: Option<Expression>,
4212}
4213
4214#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4216#[cfg_attr(feature = "bindings", derive(TS))]
4217pub struct RegexpExtractFunc {
4218 pub this: Expression,
4219 pub pattern: Expression,
4220 pub group: Option<Expression>,
4221}
4222
4223#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4225#[cfg_attr(feature = "bindings", derive(TS))]
4226pub struct RoundFunc {
4227 pub this: Expression,
4228 pub decimals: Option<Expression>,
4229}
4230
4231#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4233#[cfg_attr(feature = "bindings", derive(TS))]
4234pub struct FloorFunc {
4235 pub this: Expression,
4236 pub scale: Option<Expression>,
4237 #[serde(skip_serializing_if = "Option::is_none", default)]
4239 pub to: Option<Expression>,
4240}
4241
4242#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4244#[cfg_attr(feature = "bindings", derive(TS))]
4245pub struct CeilFunc {
4246 pub this: Expression,
4247 #[serde(skip_serializing_if = "Option::is_none", default)]
4248 pub decimals: Option<Expression>,
4249 #[serde(skip_serializing_if = "Option::is_none", default)]
4251 pub to: Option<Expression>,
4252}
4253
4254#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4256#[cfg_attr(feature = "bindings", derive(TS))]
4257pub struct LogFunc {
4258 pub this: Expression,
4259 pub base: Option<Expression>,
4260}
4261
4262#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4264#[cfg_attr(feature = "bindings", derive(TS))]
4265pub struct CurrentDate;
4266
4267#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4269#[cfg_attr(feature = "bindings", derive(TS))]
4270pub struct CurrentTime {
4271 pub precision: Option<u32>,
4272}
4273
4274#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4276#[cfg_attr(feature = "bindings", derive(TS))]
4277pub struct CurrentTimestamp {
4278 pub precision: Option<u32>,
4279 #[serde(default)]
4281 pub sysdate: bool,
4282}
4283
4284#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4286#[cfg_attr(feature = "bindings", derive(TS))]
4287pub struct CurrentTimestampLTZ {
4288 pub precision: Option<u32>,
4289}
4290
4291#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4293#[cfg_attr(feature = "bindings", derive(TS))]
4294pub struct AtTimeZone {
4295 pub this: Expression,
4297 pub zone: Expression,
4299}
4300
4301#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4303#[cfg_attr(feature = "bindings", derive(TS))]
4304pub struct DateAddFunc {
4305 pub this: Expression,
4306 pub interval: Expression,
4307 pub unit: IntervalUnit,
4308}
4309
4310#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4312#[cfg_attr(feature = "bindings", derive(TS))]
4313pub struct DateDiffFunc {
4314 pub this: Expression,
4315 pub expression: Expression,
4316 pub unit: Option<IntervalUnit>,
4317}
4318
4319#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4321#[cfg_attr(feature = "bindings", derive(TS))]
4322pub struct DateTruncFunc {
4323 pub this: Expression,
4324 pub unit: DateTimeField,
4325}
4326
4327#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4329#[cfg_attr(feature = "bindings", derive(TS))]
4330pub struct ExtractFunc {
4331 pub this: Expression,
4332 pub field: DateTimeField,
4333}
4334
4335#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
4336#[cfg_attr(feature = "bindings", derive(TS))]
4337pub enum DateTimeField {
4338 Year,
4339 Month,
4340 Day,
4341 Hour,
4342 Minute,
4343 Second,
4344 Millisecond,
4345 Microsecond,
4346 DayOfWeek,
4347 DayOfYear,
4348 Week,
4349 WeekWithModifier(String),
4351 Quarter,
4352 Epoch,
4353 Timezone,
4354 TimezoneHour,
4355 TimezoneMinute,
4356 Date,
4357 Time,
4358 Custom(String),
4360}
4361
4362#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4364#[cfg_attr(feature = "bindings", derive(TS))]
4365pub struct ToDateFunc {
4366 pub this: Expression,
4367 pub format: Option<Expression>,
4368}
4369
4370#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4372#[cfg_attr(feature = "bindings", derive(TS))]
4373pub struct ToTimestampFunc {
4374 pub this: Expression,
4375 pub format: Option<Expression>,
4376}
4377
4378#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4380#[cfg_attr(feature = "bindings", derive(TS))]
4381pub struct IfFunc {
4382 pub condition: Expression,
4383 pub true_value: Expression,
4384 pub false_value: Option<Expression>,
4385 #[serde(skip_serializing_if = "Option::is_none", default)]
4387 pub original_name: Option<String>,
4388}
4389
4390#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4392#[cfg_attr(feature = "bindings", derive(TS))]
4393pub struct Nvl2Func {
4394 pub this: Expression,
4395 pub true_value: Expression,
4396 pub false_value: Expression,
4397}
4398
4399#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4405#[cfg_attr(feature = "bindings", derive(TS))]
4406pub struct AggFunc {
4407 pub this: Expression,
4408 pub distinct: bool,
4409 pub filter: Option<Expression>,
4410 pub order_by: Vec<Ordered>,
4411 #[serde(skip_serializing_if = "Option::is_none", default)]
4413 pub name: Option<String>,
4414 #[serde(skip_serializing_if = "Option::is_none", default)]
4416 pub ignore_nulls: Option<bool>,
4417 #[serde(skip_serializing_if = "Option::is_none", default)]
4420 pub having_max: Option<(Box<Expression>, bool)>,
4421 #[serde(skip_serializing_if = "Option::is_none", default)]
4423 pub limit: Option<Box<Expression>>,
4424}
4425
4426#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4428#[cfg_attr(feature = "bindings", derive(TS))]
4429pub struct CountFunc {
4430 pub this: Option<Expression>,
4431 pub star: bool,
4432 pub distinct: bool,
4433 pub filter: Option<Expression>,
4434 #[serde(default, skip_serializing_if = "Option::is_none")]
4436 pub ignore_nulls: Option<bool>,
4437 #[serde(default, skip_serializing_if = "Option::is_none")]
4439 pub original_name: Option<String>,
4440}
4441
4442#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4444#[cfg_attr(feature = "bindings", derive(TS))]
4445pub struct GroupConcatFunc {
4446 pub this: Expression,
4447 pub separator: Option<Expression>,
4448 pub order_by: Option<Vec<Ordered>>,
4449 pub distinct: bool,
4450 pub filter: Option<Expression>,
4451}
4452
4453#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4455#[cfg_attr(feature = "bindings", derive(TS))]
4456pub struct StringAggFunc {
4457 pub this: Expression,
4458 #[serde(default)]
4459 pub separator: Option<Expression>,
4460 #[serde(default)]
4461 pub order_by: Option<Vec<Ordered>>,
4462 #[serde(default)]
4463 pub distinct: bool,
4464 #[serde(default)]
4465 pub filter: Option<Expression>,
4466 #[serde(default, skip_serializing_if = "Option::is_none")]
4468 pub limit: Option<Box<Expression>>,
4469}
4470
4471#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4473#[cfg_attr(feature = "bindings", derive(TS))]
4474pub struct ListAggFunc {
4475 pub this: Expression,
4476 pub separator: Option<Expression>,
4477 pub on_overflow: Option<ListAggOverflow>,
4478 pub order_by: Option<Vec<Ordered>>,
4479 pub distinct: bool,
4480 pub filter: Option<Expression>,
4481}
4482
4483#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4485#[cfg_attr(feature = "bindings", derive(TS))]
4486pub enum ListAggOverflow {
4487 Error,
4488 Truncate {
4489 filler: Option<Expression>,
4490 with_count: bool,
4491 },
4492}
4493
4494#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4496#[cfg_attr(feature = "bindings", derive(TS))]
4497pub struct SumIfFunc {
4498 pub this: Expression,
4499 pub condition: Expression,
4500 pub filter: Option<Expression>,
4501}
4502
4503#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4505#[cfg_attr(feature = "bindings", derive(TS))]
4506pub struct ApproxPercentileFunc {
4507 pub this: Expression,
4508 pub percentile: Expression,
4509 pub accuracy: Option<Expression>,
4510 pub filter: Option<Expression>,
4511}
4512
4513#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4515#[cfg_attr(feature = "bindings", derive(TS))]
4516pub struct PercentileFunc {
4517 pub this: Expression,
4518 pub percentile: Expression,
4519 pub order_by: Option<Vec<Ordered>>,
4520 pub filter: Option<Expression>,
4521}
4522
4523#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4529#[cfg_attr(feature = "bindings", derive(TS))]
4530pub struct RowNumber;
4531
4532#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4534#[cfg_attr(feature = "bindings", derive(TS))]
4535pub struct Rank {
4536 #[serde(default, skip_serializing_if = "Option::is_none")]
4538 pub order_by: Option<Vec<Ordered>>,
4539 #[serde(default, skip_serializing_if = "Vec::is_empty")]
4541 pub args: Vec<Expression>,
4542}
4543
4544#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4546#[cfg_attr(feature = "bindings", derive(TS))]
4547pub struct DenseRank {
4548 #[serde(default, skip_serializing_if = "Vec::is_empty")]
4550 pub args: Vec<Expression>,
4551}
4552
4553#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4555#[cfg_attr(feature = "bindings", derive(TS))]
4556pub struct NTileFunc {
4557 #[serde(default, skip_serializing_if = "Option::is_none")]
4559 pub num_buckets: Option<Expression>,
4560 #[serde(default, skip_serializing_if = "Option::is_none")]
4562 pub order_by: Option<Vec<Ordered>>,
4563}
4564
4565#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4567#[cfg_attr(feature = "bindings", derive(TS))]
4568pub struct LeadLagFunc {
4569 pub this: Expression,
4570 pub offset: Option<Expression>,
4571 pub default: Option<Expression>,
4572 pub ignore_nulls: bool,
4573}
4574
4575#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4577#[cfg_attr(feature = "bindings", derive(TS))]
4578pub struct ValueFunc {
4579 pub this: Expression,
4580 #[serde(default, skip_serializing_if = "Option::is_none")]
4582 pub ignore_nulls: Option<bool>,
4583}
4584
4585#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4587#[cfg_attr(feature = "bindings", derive(TS))]
4588pub struct NthValueFunc {
4589 pub this: Expression,
4590 pub offset: Expression,
4591 #[serde(default, skip_serializing_if = "Option::is_none")]
4593 pub ignore_nulls: Option<bool>,
4594 #[serde(default, skip_serializing_if = "Option::is_none")]
4597 pub from_first: Option<bool>,
4598}
4599
4600#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4602#[cfg_attr(feature = "bindings", derive(TS))]
4603pub struct PercentRank {
4604 #[serde(default, skip_serializing_if = "Option::is_none")]
4606 pub order_by: Option<Vec<Ordered>>,
4607 #[serde(default, skip_serializing_if = "Vec::is_empty")]
4609 pub args: Vec<Expression>,
4610}
4611
4612#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4614#[cfg_attr(feature = "bindings", derive(TS))]
4615pub struct CumeDist {
4616 #[serde(default, skip_serializing_if = "Option::is_none")]
4618 pub order_by: Option<Vec<Ordered>>,
4619 #[serde(default, skip_serializing_if = "Vec::is_empty")]
4621 pub args: Vec<Expression>,
4622}
4623
4624#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4630#[cfg_attr(feature = "bindings", derive(TS))]
4631pub struct PositionFunc {
4632 pub substring: Expression,
4633 pub string: Expression,
4634 pub start: Option<Expression>,
4635}
4636
4637#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4643#[cfg_attr(feature = "bindings", derive(TS))]
4644pub struct Random;
4645
4646#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4648#[cfg_attr(feature = "bindings", derive(TS))]
4649pub struct Rand {
4650 pub seed: Option<Box<Expression>>,
4651 #[serde(default)]
4653 pub lower: Option<Box<Expression>>,
4654 #[serde(default)]
4656 pub upper: Option<Box<Expression>>,
4657}
4658
4659#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4661#[cfg_attr(feature = "bindings", derive(TS))]
4662pub struct TruncateFunc {
4663 pub this: Expression,
4664 pub decimals: Option<Expression>,
4665}
4666
4667#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4669#[cfg_attr(feature = "bindings", derive(TS))]
4670pub struct Pi;
4671
4672#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4678#[cfg_attr(feature = "bindings", derive(TS))]
4679pub struct DecodeFunc {
4680 pub this: Expression,
4681 pub search_results: Vec<(Expression, Expression)>,
4682 pub default: Option<Expression>,
4683}
4684
4685#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4691#[cfg_attr(feature = "bindings", derive(TS))]
4692pub struct DateFormatFunc {
4693 pub this: Expression,
4694 pub format: Expression,
4695}
4696
4697#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4699#[cfg_attr(feature = "bindings", derive(TS))]
4700pub struct FromUnixtimeFunc {
4701 pub this: Expression,
4702 pub format: Option<Expression>,
4703}
4704
4705#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4707#[cfg_attr(feature = "bindings", derive(TS))]
4708pub struct UnixTimestampFunc {
4709 pub this: Option<Expression>,
4710 pub format: Option<Expression>,
4711}
4712
4713#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4715#[cfg_attr(feature = "bindings", derive(TS))]
4716pub struct MakeDateFunc {
4717 pub year: Expression,
4718 pub month: Expression,
4719 pub day: Expression,
4720}
4721
4722#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4724#[cfg_attr(feature = "bindings", derive(TS))]
4725pub struct MakeTimestampFunc {
4726 pub year: Expression,
4727 pub month: Expression,
4728 pub day: Expression,
4729 pub hour: Expression,
4730 pub minute: Expression,
4731 pub second: Expression,
4732 pub timezone: Option<Expression>,
4733}
4734
4735#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4737#[cfg_attr(feature = "bindings", derive(TS))]
4738pub struct LastDayFunc {
4739 pub this: Expression,
4740 #[serde(skip_serializing_if = "Option::is_none", default)]
4742 pub unit: Option<DateTimeField>,
4743}
4744
4745#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4751#[cfg_attr(feature = "bindings", derive(TS))]
4752pub struct ArrayConstructor {
4753 pub expressions: Vec<Expression>,
4754 pub bracket_notation: bool,
4755 pub use_list_keyword: bool,
4757}
4758
4759#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4761#[cfg_attr(feature = "bindings", derive(TS))]
4762pub struct ArraySortFunc {
4763 pub this: Expression,
4764 pub comparator: Option<Expression>,
4765 pub desc: bool,
4766 pub nulls_first: Option<bool>,
4767}
4768
4769#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4771#[cfg_attr(feature = "bindings", derive(TS))]
4772pub struct ArrayJoinFunc {
4773 pub this: Expression,
4774 pub separator: Expression,
4775 pub null_replacement: Option<Expression>,
4776}
4777
4778#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4780#[cfg_attr(feature = "bindings", derive(TS))]
4781pub struct UnnestFunc {
4782 pub this: Expression,
4783 #[serde(default, skip_serializing_if = "Vec::is_empty")]
4785 pub expressions: Vec<Expression>,
4786 pub with_ordinality: bool,
4787 pub alias: Option<Identifier>,
4788 #[serde(default, skip_serializing_if = "Option::is_none")]
4790 pub offset_alias: Option<Identifier>,
4791}
4792
4793#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4795#[cfg_attr(feature = "bindings", derive(TS))]
4796pub struct ArrayFilterFunc {
4797 pub this: Expression,
4798 pub filter: Expression,
4799}
4800
4801#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4803#[cfg_attr(feature = "bindings", derive(TS))]
4804pub struct ArrayTransformFunc {
4805 pub this: Expression,
4806 pub transform: Expression,
4807}
4808
4809#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4811#[cfg_attr(feature = "bindings", derive(TS))]
4812pub struct SequenceFunc {
4813 pub start: Expression,
4814 pub stop: Expression,
4815 pub step: Option<Expression>,
4816}
4817
4818#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4824#[cfg_attr(feature = "bindings", derive(TS))]
4825pub struct StructConstructor {
4826 pub fields: Vec<(Option<Identifier>, Expression)>,
4827}
4828
4829#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4831#[cfg_attr(feature = "bindings", derive(TS))]
4832pub struct StructExtractFunc {
4833 pub this: Expression,
4834 pub field: Identifier,
4835}
4836
4837#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4839#[cfg_attr(feature = "bindings", derive(TS))]
4840pub struct NamedStructFunc {
4841 pub pairs: Vec<(Expression, Expression)>,
4842}
4843
4844#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4850#[cfg_attr(feature = "bindings", derive(TS))]
4851pub struct MapConstructor {
4852 pub keys: Vec<Expression>,
4853 pub values: Vec<Expression>,
4854 #[serde(default)]
4856 pub curly_brace_syntax: bool,
4857 #[serde(default)]
4859 pub with_map_keyword: bool,
4860}
4861
4862#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4864#[cfg_attr(feature = "bindings", derive(TS))]
4865pub struct TransformFunc {
4866 pub this: Expression,
4867 pub transform: Expression,
4868}
4869
4870#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4876#[cfg_attr(feature = "bindings", derive(TS))]
4877pub struct JsonExtractFunc {
4878 pub this: Expression,
4879 pub path: Expression,
4880 pub returning: Option<DataType>,
4881 #[serde(default)]
4883 pub arrow_syntax: bool,
4884 #[serde(default)]
4886 pub hash_arrow_syntax: bool,
4887 #[serde(default)]
4889 pub wrapper_option: Option<String>,
4890 #[serde(default)]
4892 pub quotes_option: Option<String>,
4893 #[serde(default)]
4895 pub on_scalar_string: bool,
4896 #[serde(default)]
4898 pub on_error: Option<String>,
4899}
4900
4901#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4903#[cfg_attr(feature = "bindings", derive(TS))]
4904pub struct JsonPathFunc {
4905 pub this: Expression,
4906 pub paths: Vec<Expression>,
4907}
4908
4909#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4911#[cfg_attr(feature = "bindings", derive(TS))]
4912pub struct JsonObjectFunc {
4913 pub pairs: Vec<(Expression, Expression)>,
4914 pub null_handling: Option<JsonNullHandling>,
4915 #[serde(default)]
4916 pub with_unique_keys: bool,
4917 #[serde(default)]
4918 pub returning_type: Option<DataType>,
4919 #[serde(default)]
4920 pub format_json: bool,
4921 #[serde(default)]
4922 pub encoding: Option<String>,
4923 #[serde(default)]
4925 pub star: bool,
4926}
4927
4928#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
4930#[cfg_attr(feature = "bindings", derive(TS))]
4931pub enum JsonNullHandling {
4932 NullOnNull,
4933 AbsentOnNull,
4934}
4935
4936#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4938#[cfg_attr(feature = "bindings", derive(TS))]
4939pub struct JsonModifyFunc {
4940 pub this: Expression,
4941 pub path_values: Vec<(Expression, Expression)>,
4942}
4943
4944#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4946#[cfg_attr(feature = "bindings", derive(TS))]
4947pub struct JsonArrayAggFunc {
4948 pub this: Expression,
4949 pub order_by: Option<Vec<Ordered>>,
4950 pub null_handling: Option<JsonNullHandling>,
4951 pub filter: Option<Expression>,
4952}
4953
4954#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4956#[cfg_attr(feature = "bindings", derive(TS))]
4957pub struct JsonObjectAggFunc {
4958 pub key: Expression,
4959 pub value: Expression,
4960 pub null_handling: Option<JsonNullHandling>,
4961 pub filter: Option<Expression>,
4962}
4963
4964#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4970#[cfg_attr(feature = "bindings", derive(TS))]
4971pub struct ConvertFunc {
4972 pub this: Expression,
4973 pub to: DataType,
4974 pub style: Option<Expression>,
4975}
4976
4977#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4983#[cfg_attr(feature = "bindings", derive(TS))]
4984pub struct LambdaExpr {
4985 pub parameters: Vec<Identifier>,
4986 pub body: Expression,
4987 #[serde(default)]
4989 pub colon: bool,
4990 #[serde(default)]
4993 pub parameter_types: Vec<Option<DataType>>,
4994}
4995
4996#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4998#[cfg_attr(feature = "bindings", derive(TS))]
4999pub struct Parameter {
5000 pub name: Option<String>,
5001 pub index: Option<u32>,
5002 pub style: ParameterStyle,
5003 #[serde(default)]
5005 pub quoted: bool,
5006 #[serde(default)]
5008 pub string_quoted: bool,
5009 #[serde(default)]
5011 pub expression: Option<String>,
5012}
5013
5014#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
5016#[cfg_attr(feature = "bindings", derive(TS))]
5017pub enum ParameterStyle {
5018 Question, Dollar, DollarBrace, Brace, Colon, At, DoubleAt, DoubleDollar, Percent, }
5028
5029#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5031#[cfg_attr(feature = "bindings", derive(TS))]
5032pub struct Placeholder {
5033 pub index: Option<u32>,
5034}
5035
5036#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5038#[cfg_attr(feature = "bindings", derive(TS))]
5039pub struct NamedArgument {
5040 pub name: Identifier,
5041 pub value: Expression,
5042 pub separator: NamedArgSeparator,
5044}
5045
5046#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
5048#[cfg_attr(feature = "bindings", derive(TS))]
5049pub enum NamedArgSeparator {
5050 DArrow,
5052 ColonEq,
5054 Eq,
5056}
5057
5058#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5061#[cfg_attr(feature = "bindings", derive(TS))]
5062pub struct TableArgument {
5063 pub prefix: String,
5065 pub this: Expression,
5067}
5068
5069#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5071#[cfg_attr(feature = "bindings", derive(TS))]
5072pub struct SqlComment {
5073 pub text: String,
5074 pub is_block: bool,
5075}
5076
5077#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5083#[cfg_attr(feature = "bindings", derive(TS))]
5084pub struct SimilarToExpr {
5085 pub this: Expression,
5086 pub pattern: Expression,
5087 pub escape: Option<Expression>,
5088 pub not: bool,
5089}
5090
5091#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5093#[cfg_attr(feature = "bindings", derive(TS))]
5094pub struct QuantifiedExpr {
5095 pub this: Expression,
5096 pub subquery: Expression,
5097 pub op: Option<QuantifiedOp>,
5098}
5099
5100#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5102#[cfg_attr(feature = "bindings", derive(TS))]
5103pub enum QuantifiedOp {
5104 Eq,
5105 Neq,
5106 Lt,
5107 Lte,
5108 Gt,
5109 Gte,
5110}
5111
5112#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5117#[cfg_attr(feature = "bindings", derive(TS))]
5118pub struct OverlapsExpr {
5119 #[serde(skip_serializing_if = "Option::is_none")]
5121 pub this: Option<Expression>,
5122 #[serde(skip_serializing_if = "Option::is_none")]
5124 pub expression: Option<Expression>,
5125 #[serde(skip_serializing_if = "Option::is_none")]
5127 pub left_start: Option<Expression>,
5128 #[serde(skip_serializing_if = "Option::is_none")]
5130 pub left_end: Option<Expression>,
5131 #[serde(skip_serializing_if = "Option::is_none")]
5133 pub right_start: Option<Expression>,
5134 #[serde(skip_serializing_if = "Option::is_none")]
5136 pub right_end: Option<Expression>,
5137}
5138
5139#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5145#[cfg_attr(feature = "bindings", derive(TS))]
5146pub struct Subscript {
5147 pub this: Expression,
5148 pub index: Expression,
5149}
5150
5151#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5153#[cfg_attr(feature = "bindings", derive(TS))]
5154pub struct DotAccess {
5155 pub this: Expression,
5156 pub field: Identifier,
5157}
5158
5159#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5161#[cfg_attr(feature = "bindings", derive(TS))]
5162pub struct MethodCall {
5163 pub this: Expression,
5164 pub method: Identifier,
5165 pub args: Vec<Expression>,
5166}
5167
5168#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5170#[cfg_attr(feature = "bindings", derive(TS))]
5171pub struct ArraySlice {
5172 pub this: Expression,
5173 pub start: Option<Expression>,
5174 pub end: Option<Expression>,
5175}
5176
5177#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5183#[cfg_attr(feature = "bindings", derive(TS))]
5184pub enum OnCommit {
5185 PreserveRows,
5187 DeleteRows,
5189}
5190
5191#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5193#[cfg_attr(feature = "bindings", derive(TS))]
5194pub struct CreateTable {
5195 pub name: TableRef,
5196 #[serde(default, skip_serializing_if = "Option::is_none")]
5198 pub on_cluster: Option<OnCluster>,
5199 pub columns: Vec<ColumnDef>,
5200 pub constraints: Vec<TableConstraint>,
5201 pub if_not_exists: bool,
5202 pub temporary: bool,
5203 pub or_replace: bool,
5204 #[serde(default, skip_serializing_if = "Option::is_none")]
5206 pub table_modifier: Option<String>,
5207 pub as_select: Option<Expression>,
5208 #[serde(default)]
5210 pub as_select_parenthesized: bool,
5211 #[serde(default)]
5213 pub on_commit: Option<OnCommit>,
5214 #[serde(default)]
5216 pub clone_source: Option<TableRef>,
5217 #[serde(default, skip_serializing_if = "Option::is_none")]
5219 pub clone_at_clause: Option<Expression>,
5220 #[serde(default)]
5222 pub is_copy: bool,
5223 #[serde(default)]
5225 pub shallow_clone: bool,
5226 #[serde(default)]
5228 pub leading_comments: Vec<String>,
5229 #[serde(default)]
5231 pub with_properties: Vec<(String, String)>,
5232 #[serde(default)]
5234 pub teradata_post_name_options: Vec<String>,
5235 #[serde(default)]
5237 pub with_data: Option<bool>,
5238 #[serde(default)]
5240 pub with_statistics: Option<bool>,
5241 #[serde(default)]
5243 pub teradata_indexes: Vec<TeradataIndex>,
5244 #[serde(default)]
5246 pub with_cte: Option<With>,
5247 #[serde(default)]
5249 pub properties: Vec<Expression>,
5250 #[serde(default, skip_serializing_if = "Option::is_none")]
5252 pub partition_of: Option<Expression>,
5253 #[serde(default)]
5255 pub post_table_properties: Vec<Expression>,
5256 #[serde(default)]
5258 pub mysql_table_options: Vec<(String, String)>,
5259 #[serde(default, skip_serializing_if = "Vec::is_empty")]
5261 pub inherits: Vec<TableRef>,
5262 #[serde(default, skip_serializing_if = "Option::is_none")]
5264 pub on_property: Option<OnProperty>,
5265 #[serde(default)]
5267 pub copy_grants: bool,
5268 #[serde(default, skip_serializing_if = "Option::is_none")]
5270 pub using_template: Option<Box<Expression>>,
5271 #[serde(default, skip_serializing_if = "Option::is_none")]
5273 pub rollup: Option<RollupProperty>,
5274}
5275
5276#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5278#[cfg_attr(feature = "bindings", derive(TS))]
5279pub struct TeradataIndex {
5280 pub kind: TeradataIndexKind,
5282 pub name: Option<String>,
5284 pub columns: Vec<String>,
5286}
5287
5288#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5290#[cfg_attr(feature = "bindings", derive(TS))]
5291pub enum TeradataIndexKind {
5292 NoPrimary,
5294 Primary,
5296 PrimaryAmp,
5298 Unique,
5300 UniquePrimary,
5302 Secondary,
5304}
5305
5306impl CreateTable {
5307 pub fn new(name: impl Into<String>) -> Self {
5308 Self {
5309 name: TableRef::new(name),
5310 on_cluster: None,
5311 columns: Vec::new(),
5312 constraints: Vec::new(),
5313 if_not_exists: false,
5314 temporary: false,
5315 or_replace: false,
5316 table_modifier: None,
5317 as_select: None,
5318 as_select_parenthesized: false,
5319 on_commit: None,
5320 clone_source: None,
5321 clone_at_clause: None,
5322 shallow_clone: false,
5323 is_copy: false,
5324 leading_comments: Vec::new(),
5325 with_properties: Vec::new(),
5326 teradata_post_name_options: Vec::new(),
5327 with_data: None,
5328 with_statistics: None,
5329 teradata_indexes: Vec::new(),
5330 with_cte: None,
5331 properties: Vec::new(),
5332 partition_of: None,
5333 post_table_properties: Vec::new(),
5334 mysql_table_options: Vec::new(),
5335 inherits: Vec::new(),
5336 on_property: None,
5337 copy_grants: false,
5338 using_template: None,
5339 rollup: None,
5340 }
5341 }
5342}
5343
5344#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
5346#[cfg_attr(feature = "bindings", derive(TS))]
5347pub enum SortOrder {
5348 Asc,
5349 Desc,
5350}
5351
5352#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5354#[cfg_attr(feature = "bindings", derive(TS))]
5355pub enum ConstraintType {
5356 NotNull,
5357 Null,
5358 PrimaryKey,
5359 Unique,
5360 Default,
5361 AutoIncrement,
5362 Collate,
5363 Comment,
5364 References,
5365 Check,
5366 GeneratedAsIdentity,
5367 Tags,
5369 ComputedColumn,
5371 GeneratedAsRow,
5373 OnUpdate,
5375 Path,
5377 Encode,
5379}
5380
5381#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5383#[cfg_attr(feature = "bindings", derive(TS))]
5384pub struct ColumnDef {
5385 pub name: Identifier,
5386 pub data_type: DataType,
5387 pub nullable: Option<bool>,
5388 pub default: Option<Expression>,
5389 pub primary_key: bool,
5390 #[serde(default)]
5392 pub primary_key_order: Option<SortOrder>,
5393 pub unique: bool,
5394 #[serde(default)]
5396 pub unique_nulls_not_distinct: bool,
5397 pub auto_increment: bool,
5398 pub comment: Option<String>,
5399 pub constraints: Vec<ColumnConstraint>,
5400 #[serde(default)]
5402 pub constraint_order: Vec<ConstraintType>,
5403 #[serde(default)]
5405 pub format: Option<String>,
5406 #[serde(default)]
5408 pub title: Option<String>,
5409 #[serde(default)]
5411 pub inline_length: Option<u64>,
5412 #[serde(default)]
5414 pub compress: Option<Vec<Expression>>,
5415 #[serde(default)]
5417 pub character_set: Option<String>,
5418 #[serde(default)]
5420 pub uppercase: bool,
5421 #[serde(default)]
5423 pub casespecific: Option<bool>,
5424 #[serde(default)]
5426 pub auto_increment_start: Option<Box<Expression>>,
5427 #[serde(default)]
5429 pub auto_increment_increment: Option<Box<Expression>>,
5430 #[serde(default)]
5432 pub auto_increment_order: Option<bool>,
5433 #[serde(default)]
5435 pub unsigned: bool,
5436 #[serde(default)]
5438 pub zerofill: bool,
5439 #[serde(default, skip_serializing_if = "Option::is_none")]
5441 pub on_update: Option<Expression>,
5442 #[serde(default, skip_serializing_if = "Option::is_none")]
5444 pub unique_constraint_name: Option<String>,
5445 #[serde(default, skip_serializing_if = "Option::is_none")]
5447 pub not_null_constraint_name: Option<String>,
5448 #[serde(default, skip_serializing_if = "Option::is_none")]
5450 pub primary_key_constraint_name: Option<String>,
5451 #[serde(default, skip_serializing_if = "Option::is_none")]
5453 pub check_constraint_name: Option<String>,
5454 #[serde(default, skip_serializing_if = "Vec::is_empty")]
5456 pub options: Vec<Expression>,
5457 #[serde(default)]
5459 pub no_type: bool,
5460 #[serde(default, skip_serializing_if = "Option::is_none")]
5462 pub encoding: Option<String>,
5463 #[serde(default, skip_serializing_if = "Option::is_none")]
5465 pub codec: Option<String>,
5466 #[serde(default, skip_serializing_if = "Option::is_none")]
5468 pub ephemeral: Option<Option<Box<Expression>>>,
5469 #[serde(default, skip_serializing_if = "Option::is_none")]
5471 pub materialized_expr: Option<Box<Expression>>,
5472 #[serde(default, skip_serializing_if = "Option::is_none")]
5474 pub alias_expr: Option<Box<Expression>>,
5475 #[serde(default, skip_serializing_if = "Option::is_none")]
5477 pub ttl_expr: Option<Box<Expression>>,
5478 #[serde(default)]
5480 pub not_for_replication: bool,
5481}
5482
5483impl ColumnDef {
5484 pub fn new(name: impl Into<String>, data_type: DataType) -> Self {
5485 Self {
5486 name: Identifier::new(name),
5487 data_type,
5488 nullable: None,
5489 default: None,
5490 primary_key: false,
5491 primary_key_order: None,
5492 unique: false,
5493 unique_nulls_not_distinct: false,
5494 auto_increment: false,
5495 comment: None,
5496 constraints: Vec::new(),
5497 constraint_order: Vec::new(),
5498 format: None,
5499 title: None,
5500 inline_length: None,
5501 compress: None,
5502 character_set: None,
5503 uppercase: false,
5504 casespecific: None,
5505 auto_increment_start: None,
5506 auto_increment_increment: None,
5507 auto_increment_order: None,
5508 unsigned: false,
5509 zerofill: false,
5510 on_update: None,
5511 unique_constraint_name: None,
5512 not_null_constraint_name: None,
5513 primary_key_constraint_name: None,
5514 check_constraint_name: None,
5515 options: Vec::new(),
5516 no_type: false,
5517 encoding: None,
5518 codec: None,
5519 ephemeral: None,
5520 materialized_expr: None,
5521 alias_expr: None,
5522 ttl_expr: None,
5523 not_for_replication: false,
5524 }
5525 }
5526}
5527
5528#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5530#[cfg_attr(feature = "bindings", derive(TS))]
5531pub enum ColumnConstraint {
5532 NotNull,
5533 Null,
5534 Unique,
5535 PrimaryKey,
5536 Default(Expression),
5537 Check(Expression),
5538 References(ForeignKeyRef),
5539 GeneratedAsIdentity(GeneratedAsIdentity),
5540 Collate(Identifier),
5541 Comment(String),
5542 Tags(Tags),
5544 ComputedColumn(ComputedColumn),
5547 GeneratedAsRow(GeneratedAsRow),
5549 Path(Expression),
5551}
5552
5553#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5555#[cfg_attr(feature = "bindings", derive(TS))]
5556pub struct ComputedColumn {
5557 pub expression: Box<Expression>,
5559 #[serde(default)]
5561 pub persisted: bool,
5562 #[serde(default)]
5564 pub not_null: bool,
5565 #[serde(default)]
5568 pub persistence_kind: Option<String>,
5569 #[serde(default, skip_serializing_if = "Option::is_none")]
5571 pub data_type: Option<DataType>,
5572}
5573
5574#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5576#[cfg_attr(feature = "bindings", derive(TS))]
5577pub struct GeneratedAsRow {
5578 pub start: bool,
5580 #[serde(default)]
5582 pub hidden: bool,
5583}
5584
5585#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5587#[cfg_attr(feature = "bindings", derive(TS))]
5588pub struct GeneratedAsIdentity {
5589 pub always: bool,
5591 pub on_null: bool,
5593 pub start: Option<Box<Expression>>,
5595 pub increment: Option<Box<Expression>>,
5597 pub minvalue: Option<Box<Expression>>,
5599 pub maxvalue: Option<Box<Expression>>,
5601 pub cycle: Option<bool>,
5603}
5604
5605#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5607#[cfg_attr(feature = "bindings", derive(TS))]
5608pub struct ConstraintModifiers {
5609 pub enforced: Option<bool>,
5611 pub deferrable: Option<bool>,
5613 pub initially_deferred: Option<bool>,
5615 pub norely: bool,
5617 pub rely: bool,
5619 #[serde(default)]
5621 pub using: Option<String>,
5622 #[serde(default)]
5624 pub using_before_columns: bool,
5625 #[serde(default, skip_serializing_if = "Option::is_none")]
5627 pub comment: Option<String>,
5628 #[serde(default, skip_serializing_if = "Option::is_none")]
5630 pub visible: Option<bool>,
5631 #[serde(default, skip_serializing_if = "Option::is_none")]
5633 pub engine_attribute: Option<String>,
5634 #[serde(default, skip_serializing_if = "Option::is_none")]
5636 pub with_parser: Option<String>,
5637 #[serde(default)]
5639 pub not_valid: bool,
5640 #[serde(default, skip_serializing_if = "Option::is_none")]
5642 pub clustered: Option<String>,
5643 #[serde(default, skip_serializing_if = "Option::is_none")]
5645 pub on_conflict: Option<String>,
5646 #[serde(default, skip_serializing_if = "Vec::is_empty")]
5648 pub with_options: Vec<(String, String)>,
5649 #[serde(default, skip_serializing_if = "Option::is_none")]
5651 pub on_filegroup: Option<Identifier>,
5652}
5653
5654#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5656#[cfg_attr(feature = "bindings", derive(TS))]
5657pub enum TableConstraint {
5658 PrimaryKey {
5659 name: Option<Identifier>,
5660 columns: Vec<Identifier>,
5661 #[serde(default)]
5663 include_columns: Vec<Identifier>,
5664 #[serde(default)]
5665 modifiers: ConstraintModifiers,
5666 #[serde(default)]
5668 has_constraint_keyword: bool,
5669 },
5670 Unique {
5671 name: Option<Identifier>,
5672 columns: Vec<Identifier>,
5673 #[serde(default)]
5675 columns_parenthesized: bool,
5676 #[serde(default)]
5677 modifiers: ConstraintModifiers,
5678 #[serde(default)]
5680 has_constraint_keyword: bool,
5681 #[serde(default)]
5683 nulls_not_distinct: bool,
5684 },
5685 ForeignKey {
5686 name: Option<Identifier>,
5687 columns: Vec<Identifier>,
5688 #[serde(default)]
5689 references: Option<ForeignKeyRef>,
5690 #[serde(default)]
5692 on_delete: Option<ReferentialAction>,
5693 #[serde(default)]
5695 on_update: Option<ReferentialAction>,
5696 #[serde(default)]
5697 modifiers: ConstraintModifiers,
5698 },
5699 Check {
5700 name: Option<Identifier>,
5701 expression: Expression,
5702 #[serde(default)]
5703 modifiers: ConstraintModifiers,
5704 },
5705 Index {
5707 name: Option<Identifier>,
5708 columns: Vec<Identifier>,
5709 #[serde(default)]
5711 kind: Option<String>,
5712 #[serde(default)]
5713 modifiers: ConstraintModifiers,
5714 #[serde(default)]
5716 use_key_keyword: bool,
5717 #[serde(default, skip_serializing_if = "Option::is_none")]
5719 expression: Option<Box<Expression>>,
5720 #[serde(default, skip_serializing_if = "Option::is_none")]
5722 index_type: Option<Box<Expression>>,
5723 #[serde(default, skip_serializing_if = "Option::is_none")]
5725 granularity: Option<Box<Expression>>,
5726 },
5727 Projection {
5729 name: Identifier,
5730 expression: Expression,
5731 },
5732 Like {
5734 source: TableRef,
5735 options: Vec<(LikeOptionAction, String)>,
5737 },
5738 PeriodForSystemTime {
5740 start_col: Identifier,
5741 end_col: Identifier,
5742 },
5743 Exclude {
5746 name: Option<Identifier>,
5747 #[serde(default)]
5749 using: Option<String>,
5750 elements: Vec<ExcludeElement>,
5752 #[serde(default)]
5754 include_columns: Vec<Identifier>,
5755 #[serde(default)]
5757 where_clause: Option<Box<Expression>>,
5758 #[serde(default)]
5760 with_params: Vec<(String, String)>,
5761 #[serde(default)]
5763 using_index_tablespace: Option<String>,
5764 #[serde(default)]
5765 modifiers: ConstraintModifiers,
5766 },
5767 Tags(Tags),
5769 InitiallyDeferred {
5773 deferred: bool,
5775 },
5776}
5777
5778#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5780#[cfg_attr(feature = "bindings", derive(TS))]
5781pub struct ExcludeElement {
5782 pub expression: String,
5784 pub operator: String,
5786}
5787
5788#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
5790#[cfg_attr(feature = "bindings", derive(TS))]
5791pub enum LikeOptionAction {
5792 Including,
5793 Excluding,
5794}
5795
5796#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
5798#[cfg_attr(feature = "bindings", derive(TS))]
5799pub enum MatchType {
5800 Full,
5801 Partial,
5802 Simple,
5803}
5804
5805#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5807#[cfg_attr(feature = "bindings", derive(TS))]
5808pub struct ForeignKeyRef {
5809 pub table: TableRef,
5810 pub columns: Vec<Identifier>,
5811 pub on_delete: Option<ReferentialAction>,
5812 pub on_update: Option<ReferentialAction>,
5813 #[serde(default)]
5815 pub on_update_first: bool,
5816 #[serde(default)]
5818 pub match_type: Option<MatchType>,
5819 #[serde(default)]
5821 pub match_after_actions: bool,
5822 #[serde(default)]
5824 pub constraint_name: Option<String>,
5825 #[serde(default)]
5827 pub deferrable: Option<bool>,
5828 #[serde(default)]
5830 pub has_foreign_key_keywords: bool,
5831}
5832
5833#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
5835#[cfg_attr(feature = "bindings", derive(TS))]
5836pub enum ReferentialAction {
5837 Cascade,
5838 SetNull,
5839 SetDefault,
5840 Restrict,
5841 NoAction,
5842}
5843
5844#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5846#[cfg_attr(feature = "bindings", derive(TS))]
5847pub struct DropTable {
5848 pub names: Vec<TableRef>,
5849 pub if_exists: bool,
5850 pub cascade: bool,
5851 #[serde(default)]
5853 pub cascade_constraints: bool,
5854 #[serde(default)]
5856 pub purge: bool,
5857 #[serde(default)]
5859 pub leading_comments: Vec<String>,
5860}
5861
5862impl DropTable {
5863 pub fn new(name: impl Into<String>) -> Self {
5864 Self {
5865 names: vec![TableRef::new(name)],
5866 if_exists: false,
5867 cascade: false,
5868 cascade_constraints: false,
5869 purge: false,
5870 leading_comments: Vec::new(),
5871 }
5872 }
5873}
5874
5875#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5877#[cfg_attr(feature = "bindings", derive(TS))]
5878pub struct AlterTable {
5879 pub name: TableRef,
5880 pub actions: Vec<AlterTableAction>,
5881 #[serde(default)]
5883 pub if_exists: bool,
5884 #[serde(default, skip_serializing_if = "Option::is_none")]
5886 pub algorithm: Option<String>,
5887 #[serde(default, skip_serializing_if = "Option::is_none")]
5889 pub lock: Option<String>,
5890 #[serde(default, skip_serializing_if = "Option::is_none")]
5892 pub with_check: Option<String>,
5893 #[serde(default, skip_serializing_if = "Option::is_none")]
5895 pub partition: Option<Vec<(Identifier, Expression)>>,
5896 #[serde(default, skip_serializing_if = "Option::is_none")]
5898 pub on_cluster: Option<OnCluster>,
5899}
5900
5901impl AlterTable {
5902 pub fn new(name: impl Into<String>) -> Self {
5903 Self {
5904 name: TableRef::new(name),
5905 actions: Vec::new(),
5906 if_exists: false,
5907 algorithm: None,
5908 lock: None,
5909 with_check: None,
5910 partition: None,
5911 on_cluster: None,
5912 }
5913 }
5914}
5915
5916#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5918#[cfg_attr(feature = "bindings", derive(TS))]
5919pub enum ColumnPosition {
5920 First,
5921 After(Identifier),
5922}
5923
5924#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5926#[cfg_attr(feature = "bindings", derive(TS))]
5927pub enum AlterTableAction {
5928 AddColumn {
5929 column: ColumnDef,
5930 if_not_exists: bool,
5931 position: Option<ColumnPosition>,
5932 },
5933 DropColumn {
5934 name: Identifier,
5935 if_exists: bool,
5936 cascade: bool,
5937 },
5938 RenameColumn {
5939 old_name: Identifier,
5940 new_name: Identifier,
5941 if_exists: bool,
5942 },
5943 AlterColumn {
5944 name: Identifier,
5945 action: AlterColumnAction,
5946 #[serde(default)]
5948 use_modify_keyword: bool,
5949 },
5950 RenameTable(TableRef),
5951 AddConstraint(TableConstraint),
5952 DropConstraint {
5953 name: Identifier,
5954 if_exists: bool,
5955 },
5956 DropForeignKey {
5958 name: Identifier,
5959 },
5960 DropPartition {
5962 partitions: Vec<Vec<(Identifier, Expression)>>,
5964 if_exists: bool,
5965 },
5966 AddPartition {
5968 partition: Expression,
5970 if_not_exists: bool,
5971 location: Option<Expression>,
5972 },
5973 Delete {
5975 where_clause: Expression,
5976 },
5977 SwapWith(TableRef),
5979 SetProperty {
5981 properties: Vec<(String, Expression)>,
5982 },
5983 UnsetProperty {
5985 properties: Vec<String>,
5986 },
5987 ClusterBy {
5989 expressions: Vec<Expression>,
5990 },
5991 SetTag {
5993 expressions: Vec<(String, Expression)>,
5994 },
5995 UnsetTag {
5997 names: Vec<String>,
5998 },
5999 SetOptions {
6001 expressions: Vec<Expression>,
6002 },
6003 AlterIndex {
6005 name: Identifier,
6006 visible: bool,
6007 },
6008 SetAttribute {
6010 attribute: String,
6011 },
6012 SetStageFileFormat {
6014 options: Option<Expression>,
6015 },
6016 SetStageCopyOptions {
6018 options: Option<Expression>,
6019 },
6020 AddColumns {
6022 columns: Vec<ColumnDef>,
6023 cascade: bool,
6024 },
6025 DropColumns {
6027 names: Vec<Identifier>,
6028 },
6029 ChangeColumn {
6032 old_name: Identifier,
6033 new_name: Identifier,
6034 #[serde(default, skip_serializing_if = "Option::is_none")]
6035 data_type: Option<DataType>,
6036 comment: Option<String>,
6037 #[serde(default)]
6038 cascade: bool,
6039 },
6040 AlterSortKey {
6043 this: Option<String>,
6045 expressions: Vec<Expression>,
6047 compound: bool,
6049 },
6050 AlterDistStyle {
6054 style: String,
6056 distkey: Option<Identifier>,
6058 },
6059 SetTableProperties {
6061 properties: Vec<(Expression, Expression)>,
6062 },
6063 SetLocation {
6065 location: String,
6066 },
6067 SetFileFormat {
6069 format: String,
6070 },
6071 ReplacePartition {
6073 partition: Expression,
6074 source: Option<Box<Expression>>,
6075 },
6076 Raw {
6078 sql: String,
6079 },
6080}
6081
6082#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6084#[cfg_attr(feature = "bindings", derive(TS))]
6085pub enum AlterColumnAction {
6086 SetDataType {
6087 data_type: DataType,
6088 using: Option<Expression>,
6090 #[serde(default, skip_serializing_if = "Option::is_none")]
6092 collate: Option<String>,
6093 },
6094 SetDefault(Expression),
6095 DropDefault,
6096 SetNotNull,
6097 DropNotNull,
6098 Comment(String),
6100 SetVisible,
6102 SetInvisible,
6104}
6105
6106#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6108#[cfg_attr(feature = "bindings", derive(TS))]
6109pub struct CreateIndex {
6110 pub name: Identifier,
6111 pub table: TableRef,
6112 pub columns: Vec<IndexColumn>,
6113 pub unique: bool,
6114 pub if_not_exists: bool,
6115 pub using: Option<String>,
6116 #[serde(default)]
6118 pub clustered: Option<String>,
6119 #[serde(default)]
6121 pub concurrently: bool,
6122 #[serde(default)]
6124 pub where_clause: Option<Box<Expression>>,
6125 #[serde(default, skip_serializing_if = "Vec::is_empty")]
6127 pub include_columns: Vec<Identifier>,
6128 #[serde(default, skip_serializing_if = "Vec::is_empty")]
6130 pub with_options: Vec<(String, String)>,
6131 #[serde(default)]
6133 pub on_filegroup: Option<String>,
6134}
6135
6136impl CreateIndex {
6137 pub fn new(name: impl Into<String>, table: impl Into<String>) -> Self {
6138 Self {
6139 name: Identifier::new(name),
6140 table: TableRef::new(table),
6141 columns: Vec::new(),
6142 unique: false,
6143 if_not_exists: false,
6144 using: None,
6145 clustered: None,
6146 concurrently: false,
6147 where_clause: None,
6148 include_columns: Vec::new(),
6149 with_options: Vec::new(),
6150 on_filegroup: None,
6151 }
6152 }
6153}
6154
6155#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6157#[cfg_attr(feature = "bindings", derive(TS))]
6158pub struct IndexColumn {
6159 pub column: Identifier,
6160 pub desc: bool,
6161 #[serde(default)]
6163 pub asc: bool,
6164 pub nulls_first: Option<bool>,
6165 #[serde(default, skip_serializing_if = "Option::is_none")]
6167 pub opclass: Option<String>,
6168}
6169
6170#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6172#[cfg_attr(feature = "bindings", derive(TS))]
6173pub struct DropIndex {
6174 pub name: Identifier,
6175 pub table: Option<TableRef>,
6176 pub if_exists: bool,
6177 #[serde(default)]
6179 pub concurrently: bool,
6180}
6181
6182impl DropIndex {
6183 pub fn new(name: impl Into<String>) -> Self {
6184 Self {
6185 name: Identifier::new(name),
6186 table: None,
6187 if_exists: false,
6188 concurrently: false,
6189 }
6190 }
6191}
6192
6193#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6195#[cfg_attr(feature = "bindings", derive(TS))]
6196pub struct ViewColumn {
6197 pub name: Identifier,
6198 pub comment: Option<String>,
6199 #[serde(default, skip_serializing_if = "Vec::is_empty")]
6201 pub options: Vec<Expression>,
6202}
6203
6204impl ViewColumn {
6205 pub fn new(name: impl Into<String>) -> Self {
6206 Self {
6207 name: Identifier::new(name),
6208 comment: None,
6209 options: Vec::new(),
6210 }
6211 }
6212
6213 pub fn with_comment(name: impl Into<String>, comment: impl Into<String>) -> Self {
6214 Self {
6215 name: Identifier::new(name),
6216 comment: Some(comment.into()),
6217 options: Vec::new(),
6218 }
6219 }
6220}
6221
6222#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6224#[cfg_attr(feature = "bindings", derive(TS))]
6225pub struct CreateView {
6226 pub name: TableRef,
6227 pub columns: Vec<ViewColumn>,
6228 pub query: Expression,
6229 pub or_replace: bool,
6230 pub if_not_exists: bool,
6231 pub materialized: bool,
6232 pub temporary: bool,
6233 #[serde(default)]
6235 pub secure: bool,
6236 #[serde(skip_serializing_if = "Option::is_none")]
6238 pub algorithm: Option<String>,
6239 #[serde(skip_serializing_if = "Option::is_none")]
6241 pub definer: Option<String>,
6242 #[serde(skip_serializing_if = "Option::is_none")]
6244 pub security: Option<FunctionSecurity>,
6245 #[serde(default = "default_true")]
6247 pub security_sql_style: bool,
6248 #[serde(default)]
6250 pub query_parenthesized: bool,
6251 #[serde(skip_serializing_if = "Option::is_none")]
6253 pub locking_mode: Option<String>,
6254 #[serde(skip_serializing_if = "Option::is_none")]
6256 pub locking_access: Option<String>,
6257 #[serde(default)]
6259 pub copy_grants: bool,
6260 #[serde(skip_serializing_if = "Option::is_none", default)]
6262 pub comment: Option<String>,
6263 #[serde(default)]
6265 pub tags: Vec<(String, String)>,
6266 #[serde(default)]
6268 pub options: Vec<Expression>,
6269 #[serde(skip_serializing_if = "Option::is_none", default)]
6271 pub build: Option<String>,
6272 #[serde(skip_serializing_if = "Option::is_none", default)]
6274 pub refresh: Option<Box<RefreshTriggerProperty>>,
6275 #[serde(skip_serializing_if = "Option::is_none", default)]
6278 pub schema: Option<Box<Schema>>,
6279 #[serde(skip_serializing_if = "Option::is_none", default)]
6281 pub unique_key: Option<Box<UniqueKeyProperty>>,
6282 #[serde(default)]
6284 pub no_schema_binding: bool,
6285 #[serde(skip_serializing_if = "Option::is_none", default)]
6287 pub auto_refresh: Option<bool>,
6288 #[serde(default, skip_serializing_if = "Option::is_none")]
6290 pub on_cluster: Option<OnCluster>,
6291 #[serde(default, skip_serializing_if = "Option::is_none")]
6293 pub to_table: Option<TableRef>,
6294 #[serde(default, skip_serializing_if = "Vec::is_empty")]
6296 pub table_properties: Vec<Expression>,
6297}
6298
6299impl CreateView {
6300 pub fn new(name: impl Into<String>, query: Expression) -> Self {
6301 Self {
6302 name: TableRef::new(name),
6303 columns: Vec::new(),
6304 query,
6305 or_replace: false,
6306 if_not_exists: false,
6307 materialized: false,
6308 temporary: false,
6309 secure: false,
6310 algorithm: None,
6311 definer: None,
6312 security: None,
6313 security_sql_style: true,
6314 query_parenthesized: false,
6315 locking_mode: None,
6316 locking_access: None,
6317 copy_grants: false,
6318 comment: None,
6319 tags: Vec::new(),
6320 options: Vec::new(),
6321 build: None,
6322 refresh: None,
6323 schema: None,
6324 unique_key: None,
6325 no_schema_binding: false,
6326 auto_refresh: None,
6327 on_cluster: None,
6328 to_table: None,
6329 table_properties: Vec::new(),
6330 }
6331 }
6332}
6333
6334#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6336#[cfg_attr(feature = "bindings", derive(TS))]
6337pub struct DropView {
6338 pub name: TableRef,
6339 pub if_exists: bool,
6340 pub materialized: bool,
6341}
6342
6343impl DropView {
6344 pub fn new(name: impl Into<String>) -> Self {
6345 Self {
6346 name: TableRef::new(name),
6347 if_exists: false,
6348 materialized: false,
6349 }
6350 }
6351}
6352
6353#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6355#[cfg_attr(feature = "bindings", derive(TS))]
6356pub struct Truncate {
6357 #[serde(default)]
6359 pub target: TruncateTarget,
6360 #[serde(default)]
6362 pub if_exists: bool,
6363 pub table: TableRef,
6364 #[serde(default, skip_serializing_if = "Option::is_none")]
6366 pub on_cluster: Option<OnCluster>,
6367 pub cascade: bool,
6368 #[serde(default)]
6370 pub extra_tables: Vec<TruncateTableEntry>,
6371 #[serde(default)]
6373 pub identity: Option<TruncateIdentity>,
6374 #[serde(default)]
6376 pub restrict: bool,
6377 #[serde(default, skip_serializing_if = "Option::is_none")]
6379 pub partition: Option<Box<Expression>>,
6380}
6381
6382#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6384#[cfg_attr(feature = "bindings", derive(TS))]
6385pub struct TruncateTableEntry {
6386 pub table: TableRef,
6387 #[serde(default)]
6389 pub star: bool,
6390}
6391
6392#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
6394#[cfg_attr(feature = "bindings", derive(TS))]
6395pub enum TruncateTarget {
6396 Table,
6397 Database,
6398}
6399
6400impl Default for TruncateTarget {
6401 fn default() -> Self {
6402 TruncateTarget::Table
6403 }
6404}
6405
6406#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
6408#[cfg_attr(feature = "bindings", derive(TS))]
6409pub enum TruncateIdentity {
6410 Restart,
6411 Continue,
6412}
6413
6414impl Truncate {
6415 pub fn new(table: impl Into<String>) -> Self {
6416 Self {
6417 target: TruncateTarget::Table,
6418 if_exists: false,
6419 table: TableRef::new(table),
6420 on_cluster: None,
6421 cascade: false,
6422 extra_tables: Vec::new(),
6423 identity: None,
6424 restrict: false,
6425 partition: None,
6426 }
6427 }
6428}
6429
6430#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6432#[cfg_attr(feature = "bindings", derive(TS))]
6433pub struct Use {
6434 pub kind: Option<UseKind>,
6436 pub this: Identifier,
6438}
6439
6440#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
6442#[cfg_attr(feature = "bindings", derive(TS))]
6443pub enum UseKind {
6444 Database,
6445 Schema,
6446 Role,
6447 Warehouse,
6448 Catalog,
6449 SecondaryRoles,
6451}
6452
6453#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6455#[cfg_attr(feature = "bindings", derive(TS))]
6456pub struct SetStatement {
6457 pub items: Vec<SetItem>,
6459}
6460
6461#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6463#[cfg_attr(feature = "bindings", derive(TS))]
6464pub struct SetItem {
6465 pub name: Expression,
6467 pub value: Expression,
6469 pub kind: Option<String>,
6471 #[serde(default, skip_serializing_if = "std::ops::Not::not")]
6473 pub no_equals: bool,
6474}
6475
6476#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6478#[cfg_attr(feature = "bindings", derive(TS))]
6479pub struct Cache {
6480 pub table: Identifier,
6482 pub lazy: bool,
6484 pub options: Vec<(Expression, Expression)>,
6486 pub query: Option<Expression>,
6488}
6489
6490#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6492#[cfg_attr(feature = "bindings", derive(TS))]
6493pub struct Uncache {
6494 pub table: Identifier,
6496 pub if_exists: bool,
6498}
6499
6500#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6502#[cfg_attr(feature = "bindings", derive(TS))]
6503pub struct LoadData {
6504 pub local: bool,
6506 pub inpath: String,
6508 pub overwrite: bool,
6510 pub table: Expression,
6512 pub partition: Vec<(Identifier, Expression)>,
6514 pub input_format: Option<String>,
6516 pub serde: Option<String>,
6518}
6519
6520#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6522#[cfg_attr(feature = "bindings", derive(TS))]
6523pub struct Pragma {
6524 pub schema: Option<Identifier>,
6526 pub name: Identifier,
6528 pub value: Option<Expression>,
6530 pub args: Vec<Expression>,
6532}
6533
6534#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6537#[cfg_attr(feature = "bindings", derive(TS))]
6538pub struct Privilege {
6539 pub name: String,
6541 #[serde(default, skip_serializing_if = "Vec::is_empty")]
6543 pub columns: Vec<String>,
6544}
6545
6546#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6548#[cfg_attr(feature = "bindings", derive(TS))]
6549pub struct GrantPrincipal {
6550 pub name: Identifier,
6552 pub is_role: bool,
6554 #[serde(default)]
6556 pub is_group: bool,
6557}
6558
6559#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6561#[cfg_attr(feature = "bindings", derive(TS))]
6562pub struct Grant {
6563 pub privileges: Vec<Privilege>,
6565 pub kind: Option<String>,
6567 pub securable: Identifier,
6569 #[serde(default, skip_serializing_if = "Vec::is_empty")]
6571 pub function_params: Vec<String>,
6572 pub principals: Vec<GrantPrincipal>,
6574 pub grant_option: bool,
6576 #[serde(default, skip_serializing_if = "Option::is_none")]
6578 pub as_principal: Option<Identifier>,
6579}
6580
6581#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6583#[cfg_attr(feature = "bindings", derive(TS))]
6584pub struct Revoke {
6585 pub privileges: Vec<Privilege>,
6587 pub kind: Option<String>,
6589 pub securable: Identifier,
6591 #[serde(default, skip_serializing_if = "Vec::is_empty")]
6593 pub function_params: Vec<String>,
6594 pub principals: Vec<GrantPrincipal>,
6596 pub grant_option: bool,
6598 pub cascade: bool,
6600 #[serde(default)]
6602 pub restrict: bool,
6603}
6604
6605#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6607#[cfg_attr(feature = "bindings", derive(TS))]
6608pub struct Comment {
6609 pub this: Expression,
6611 pub kind: String,
6613 pub expression: Expression,
6615 pub exists: bool,
6617 pub materialized: bool,
6619}
6620
6621#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6627#[cfg_attr(feature = "bindings", derive(TS))]
6628pub struct AlterView {
6629 pub name: TableRef,
6630 pub actions: Vec<AlterViewAction>,
6631 #[serde(default, skip_serializing_if = "Option::is_none")]
6633 pub algorithm: Option<String>,
6634 #[serde(default, skip_serializing_if = "Option::is_none")]
6636 pub definer: Option<String>,
6637 #[serde(default, skip_serializing_if = "Option::is_none")]
6639 pub sql_security: Option<String>,
6640 #[serde(default, skip_serializing_if = "Option::is_none")]
6642 pub with_option: Option<String>,
6643 #[serde(default, skip_serializing_if = "Vec::is_empty")]
6645 pub columns: Vec<ViewColumn>,
6646}
6647
6648#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6650#[cfg_attr(feature = "bindings", derive(TS))]
6651pub enum AlterViewAction {
6652 Rename(TableRef),
6654 OwnerTo(Identifier),
6656 SetSchema(Identifier),
6658 SetAuthorization(String),
6660 AlterColumn {
6662 name: Identifier,
6663 action: AlterColumnAction,
6664 },
6665 AsSelect(Box<Expression>),
6667 SetTblproperties(Vec<(String, String)>),
6669 UnsetTblproperties(Vec<String>),
6671}
6672
6673impl AlterView {
6674 pub fn new(name: impl Into<String>) -> Self {
6675 Self {
6676 name: TableRef::new(name),
6677 actions: Vec::new(),
6678 algorithm: None,
6679 definer: None,
6680 sql_security: None,
6681 with_option: None,
6682 columns: Vec::new(),
6683 }
6684 }
6685}
6686
6687#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6689#[cfg_attr(feature = "bindings", derive(TS))]
6690pub struct AlterIndex {
6691 pub name: Identifier,
6692 pub table: Option<TableRef>,
6693 pub actions: Vec<AlterIndexAction>,
6694}
6695
6696#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6698#[cfg_attr(feature = "bindings", derive(TS))]
6699pub enum AlterIndexAction {
6700 Rename(Identifier),
6702 SetTablespace(Identifier),
6704 Visible(bool),
6706}
6707
6708impl AlterIndex {
6709 pub fn new(name: impl Into<String>) -> Self {
6710 Self {
6711 name: Identifier::new(name),
6712 table: None,
6713 actions: Vec::new(),
6714 }
6715 }
6716}
6717
6718#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6720#[cfg_attr(feature = "bindings", derive(TS))]
6721pub struct CreateSchema {
6722 pub name: Identifier,
6723 pub if_not_exists: bool,
6724 pub authorization: Option<Identifier>,
6725 #[serde(default)]
6726 pub clone_from: Option<Identifier>,
6727 #[serde(default)]
6729 pub at_clause: Option<Expression>,
6730 #[serde(default)]
6732 pub properties: Vec<Expression>,
6733 #[serde(default, skip_serializing_if = "Vec::is_empty")]
6735 pub leading_comments: Vec<String>,
6736}
6737
6738impl CreateSchema {
6739 pub fn new(name: impl Into<String>) -> Self {
6740 Self {
6741 name: Identifier::new(name),
6742 if_not_exists: false,
6743 authorization: None,
6744 clone_from: None,
6745 at_clause: None,
6746 properties: Vec::new(),
6747 leading_comments: Vec::new(),
6748 }
6749 }
6750}
6751
6752#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6754#[cfg_attr(feature = "bindings", derive(TS))]
6755pub struct DropSchema {
6756 pub name: Identifier,
6757 pub if_exists: bool,
6758 pub cascade: bool,
6759}
6760
6761impl DropSchema {
6762 pub fn new(name: impl Into<String>) -> Self {
6763 Self {
6764 name: Identifier::new(name),
6765 if_exists: false,
6766 cascade: false,
6767 }
6768 }
6769}
6770
6771#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6773#[cfg_attr(feature = "bindings", derive(TS))]
6774pub struct DropNamespace {
6775 pub name: Identifier,
6776 pub if_exists: bool,
6777 pub cascade: bool,
6778}
6779
6780impl DropNamespace {
6781 pub fn new(name: impl Into<String>) -> Self {
6782 Self {
6783 name: Identifier::new(name),
6784 if_exists: false,
6785 cascade: false,
6786 }
6787 }
6788}
6789
6790#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6792#[cfg_attr(feature = "bindings", derive(TS))]
6793pub struct CreateDatabase {
6794 pub name: Identifier,
6795 pub if_not_exists: bool,
6796 pub options: Vec<DatabaseOption>,
6797 #[serde(default)]
6799 pub clone_from: Option<Identifier>,
6800 #[serde(default)]
6802 pub at_clause: Option<Expression>,
6803}
6804
6805#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6807#[cfg_attr(feature = "bindings", derive(TS))]
6808pub enum DatabaseOption {
6809 CharacterSet(String),
6810 Collate(String),
6811 Owner(Identifier),
6812 Template(Identifier),
6813 Encoding(String),
6814 Location(String),
6815}
6816
6817impl CreateDatabase {
6818 pub fn new(name: impl Into<String>) -> Self {
6819 Self {
6820 name: Identifier::new(name),
6821 if_not_exists: false,
6822 options: Vec::new(),
6823 clone_from: None,
6824 at_clause: None,
6825 }
6826 }
6827}
6828
6829#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6831#[cfg_attr(feature = "bindings", derive(TS))]
6832pub struct DropDatabase {
6833 pub name: Identifier,
6834 pub if_exists: bool,
6835}
6836
6837impl DropDatabase {
6838 pub fn new(name: impl Into<String>) -> Self {
6839 Self {
6840 name: Identifier::new(name),
6841 if_exists: false,
6842 }
6843 }
6844}
6845
6846#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6848#[cfg_attr(feature = "bindings", derive(TS))]
6849pub struct CreateFunction {
6850 pub name: TableRef,
6851 pub parameters: Vec<FunctionParameter>,
6852 pub return_type: Option<DataType>,
6853 pub body: Option<FunctionBody>,
6854 pub or_replace: bool,
6855 pub if_not_exists: bool,
6856 pub temporary: bool,
6857 pub language: Option<String>,
6858 pub deterministic: Option<bool>,
6859 pub returns_null_on_null_input: Option<bool>,
6860 pub security: Option<FunctionSecurity>,
6861 #[serde(default = "default_true")]
6863 pub has_parens: bool,
6864 #[serde(default)]
6866 pub sql_data_access: Option<SqlDataAccess>,
6867 #[serde(default, skip_serializing_if = "Option::is_none")]
6869 pub returns_table_body: Option<String>,
6870 #[serde(default)]
6872 pub language_first: bool,
6873 #[serde(default, skip_serializing_if = "Vec::is_empty")]
6875 pub set_options: Vec<FunctionSetOption>,
6876 #[serde(default)]
6878 pub strict: bool,
6879 #[serde(default, skip_serializing_if = "Vec::is_empty")]
6881 pub options: Vec<Expression>,
6882 #[serde(default)]
6884 pub is_table_function: bool,
6885 #[serde(default, skip_serializing_if = "Vec::is_empty")]
6887 pub property_order: Vec<FunctionPropertyKind>,
6888 #[serde(default, skip_serializing_if = "Vec::is_empty")]
6890 pub environment: Vec<Expression>,
6891}
6892
6893#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6895#[cfg_attr(feature = "bindings", derive(TS))]
6896pub struct FunctionSetOption {
6897 pub name: String,
6898 pub value: FunctionSetValue,
6899}
6900
6901#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6903#[cfg_attr(feature = "bindings", derive(TS))]
6904pub enum FunctionSetValue {
6905 Value { value: String, use_to: bool },
6907 FromCurrent,
6909}
6910
6911#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
6913#[cfg_attr(feature = "bindings", derive(TS))]
6914pub enum SqlDataAccess {
6915 NoSql,
6917 ContainsSql,
6919 ReadsSqlData,
6921 ModifiesSqlData,
6923}
6924
6925#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
6927#[cfg_attr(feature = "bindings", derive(TS))]
6928pub enum FunctionPropertyKind {
6929 Set,
6931 As,
6933 Language,
6935 Determinism,
6937 NullInput,
6939 Security,
6941 SqlDataAccess,
6943 Options,
6945 Environment,
6947}
6948
6949#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6951#[cfg_attr(feature = "bindings", derive(TS))]
6952pub struct FunctionParameter {
6953 pub name: Option<Identifier>,
6954 pub data_type: DataType,
6955 pub mode: Option<ParameterMode>,
6956 pub default: Option<Expression>,
6957 #[serde(default, skip_serializing_if = "Option::is_none")]
6959 pub mode_text: Option<String>,
6960}
6961
6962#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
6964#[cfg_attr(feature = "bindings", derive(TS))]
6965pub enum ParameterMode {
6966 In,
6967 Out,
6968 InOut,
6969 Variadic,
6970}
6971
6972#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6974#[cfg_attr(feature = "bindings", derive(TS))]
6975pub enum FunctionBody {
6976 Block(String),
6978 StringLiteral(String),
6980 Expression(Expression),
6982 External(String),
6984 Return(Expression),
6986 Statements(Vec<Expression>),
6988 DollarQuoted {
6991 content: String,
6992 tag: Option<String>,
6993 },
6994}
6995
6996#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
6998#[cfg_attr(feature = "bindings", derive(TS))]
6999pub enum FunctionSecurity {
7000 Definer,
7001 Invoker,
7002 None,
7004}
7005
7006impl CreateFunction {
7007 pub fn new(name: impl Into<String>) -> Self {
7008 Self {
7009 name: TableRef::new(name),
7010 parameters: Vec::new(),
7011 return_type: None,
7012 body: None,
7013 or_replace: false,
7014 if_not_exists: false,
7015 temporary: false,
7016 language: None,
7017 deterministic: None,
7018 returns_null_on_null_input: None,
7019 security: None,
7020 has_parens: true,
7021 sql_data_access: None,
7022 returns_table_body: None,
7023 language_first: false,
7024 set_options: Vec::new(),
7025 strict: false,
7026 options: Vec::new(),
7027 is_table_function: false,
7028 property_order: Vec::new(),
7029 environment: Vec::new(),
7030 }
7031 }
7032}
7033
7034#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7036#[cfg_attr(feature = "bindings", derive(TS))]
7037pub struct DropFunction {
7038 pub name: TableRef,
7039 pub parameters: Option<Vec<DataType>>,
7040 pub if_exists: bool,
7041 pub cascade: bool,
7042}
7043
7044impl DropFunction {
7045 pub fn new(name: impl Into<String>) -> Self {
7046 Self {
7047 name: TableRef::new(name),
7048 parameters: None,
7049 if_exists: false,
7050 cascade: false,
7051 }
7052 }
7053}
7054
7055#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7057#[cfg_attr(feature = "bindings", derive(TS))]
7058pub struct CreateProcedure {
7059 pub name: TableRef,
7060 pub parameters: Vec<FunctionParameter>,
7061 pub body: Option<FunctionBody>,
7062 pub or_replace: bool,
7063 pub if_not_exists: bool,
7064 pub language: Option<String>,
7065 pub security: Option<FunctionSecurity>,
7066 #[serde(default)]
7068 pub return_type: Option<DataType>,
7069 #[serde(default)]
7071 pub execute_as: Option<String>,
7072 #[serde(default, skip_serializing_if = "Vec::is_empty")]
7074 pub with_options: Vec<String>,
7075 #[serde(default = "default_true", skip_serializing_if = "is_true")]
7077 pub has_parens: bool,
7078 #[serde(default, skip_serializing_if = "std::ops::Not::not")]
7080 pub use_proc_keyword: bool,
7081}
7082
7083impl CreateProcedure {
7084 pub fn new(name: impl Into<String>) -> Self {
7085 Self {
7086 name: TableRef::new(name),
7087 parameters: Vec::new(),
7088 body: None,
7089 or_replace: false,
7090 if_not_exists: false,
7091 language: None,
7092 security: None,
7093 return_type: None,
7094 execute_as: None,
7095 with_options: Vec::new(),
7096 has_parens: true,
7097 use_proc_keyword: false,
7098 }
7099 }
7100}
7101
7102#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7104#[cfg_attr(feature = "bindings", derive(TS))]
7105pub struct DropProcedure {
7106 pub name: TableRef,
7107 pub parameters: Option<Vec<DataType>>,
7108 pub if_exists: bool,
7109 pub cascade: bool,
7110}
7111
7112impl DropProcedure {
7113 pub fn new(name: impl Into<String>) -> Self {
7114 Self {
7115 name: TableRef::new(name),
7116 parameters: None,
7117 if_exists: false,
7118 cascade: false,
7119 }
7120 }
7121}
7122
7123#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7125#[cfg_attr(feature = "bindings", derive(TS))]
7126pub enum SeqPropKind {
7127 Start,
7128 Increment,
7129 Minvalue,
7130 Maxvalue,
7131 Cache,
7132 NoCache,
7133 Cycle,
7134 NoCycle,
7135 OwnedBy,
7136 Order,
7137 NoOrder,
7138 Comment,
7139 Sharing,
7141 Keep,
7143 NoKeep,
7145 Scale,
7147 NoScale,
7149 Shard,
7151 NoShard,
7153 Session,
7155 Global,
7157 NoCacheWord,
7159 NoCycleWord,
7161 NoMinvalueWord,
7163 NoMaxvalueWord,
7165}
7166
7167#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7169#[cfg_attr(feature = "bindings", derive(TS))]
7170pub struct CreateSequence {
7171 pub name: TableRef,
7172 pub if_not_exists: bool,
7173 pub temporary: bool,
7174 #[serde(default)]
7175 pub or_replace: bool,
7176 #[serde(default, skip_serializing_if = "Option::is_none")]
7178 pub as_type: Option<DataType>,
7179 pub increment: Option<i64>,
7180 pub minvalue: Option<SequenceBound>,
7181 pub maxvalue: Option<SequenceBound>,
7182 pub start: Option<i64>,
7183 pub cache: Option<i64>,
7184 pub cycle: bool,
7185 pub owned_by: Option<TableRef>,
7186 #[serde(default)]
7188 pub owned_by_none: bool,
7189 #[serde(default)]
7191 pub order: Option<bool>,
7192 #[serde(default)]
7194 pub comment: Option<String>,
7195 #[serde(default, skip_serializing_if = "Option::is_none")]
7197 pub sharing: Option<String>,
7198 #[serde(default, skip_serializing_if = "Option::is_none")]
7200 pub scale_modifier: Option<String>,
7201 #[serde(default, skip_serializing_if = "Option::is_none")]
7203 pub shard_modifier: Option<String>,
7204 #[serde(default)]
7206 pub property_order: Vec<SeqPropKind>,
7207}
7208
7209#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7211#[cfg_attr(feature = "bindings", derive(TS))]
7212pub enum SequenceBound {
7213 Value(i64),
7214 None,
7215}
7216
7217impl CreateSequence {
7218 pub fn new(name: impl Into<String>) -> Self {
7219 Self {
7220 name: TableRef::new(name),
7221 if_not_exists: false,
7222 temporary: false,
7223 or_replace: false,
7224 as_type: None,
7225 increment: None,
7226 minvalue: None,
7227 maxvalue: None,
7228 start: None,
7229 cache: None,
7230 cycle: false,
7231 owned_by: None,
7232 owned_by_none: false,
7233 order: None,
7234 comment: None,
7235 sharing: None,
7236 scale_modifier: None,
7237 shard_modifier: None,
7238 property_order: Vec::new(),
7239 }
7240 }
7241}
7242
7243#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7245#[cfg_attr(feature = "bindings", derive(TS))]
7246pub struct DropSequence {
7247 pub name: TableRef,
7248 pub if_exists: bool,
7249 pub cascade: bool,
7250}
7251
7252impl DropSequence {
7253 pub fn new(name: impl Into<String>) -> Self {
7254 Self {
7255 name: TableRef::new(name),
7256 if_exists: false,
7257 cascade: false,
7258 }
7259 }
7260}
7261
7262#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7264#[cfg_attr(feature = "bindings", derive(TS))]
7265pub struct AlterSequence {
7266 pub name: TableRef,
7267 pub if_exists: bool,
7268 pub increment: Option<i64>,
7269 pub minvalue: Option<SequenceBound>,
7270 pub maxvalue: Option<SequenceBound>,
7271 pub start: Option<i64>,
7272 pub restart: Option<Option<i64>>,
7273 pub cache: Option<i64>,
7274 pub cycle: Option<bool>,
7275 pub owned_by: Option<Option<TableRef>>,
7276}
7277
7278impl AlterSequence {
7279 pub fn new(name: impl Into<String>) -> Self {
7280 Self {
7281 name: TableRef::new(name),
7282 if_exists: false,
7283 increment: None,
7284 minvalue: None,
7285 maxvalue: None,
7286 start: None,
7287 restart: None,
7288 cache: None,
7289 cycle: None,
7290 owned_by: None,
7291 }
7292 }
7293}
7294
7295#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7297#[cfg_attr(feature = "bindings", derive(TS))]
7298pub struct CreateTrigger {
7299 pub name: Identifier,
7300 pub table: TableRef,
7301 pub timing: TriggerTiming,
7302 pub events: Vec<TriggerEvent>,
7303 pub for_each: TriggerForEach,
7304 pub when: Option<Expression>,
7305 pub body: TriggerBody,
7306 pub or_replace: bool,
7307 pub constraint: bool,
7308 pub deferrable: Option<bool>,
7309 pub initially_deferred: Option<bool>,
7310 pub referencing: Option<TriggerReferencing>,
7311}
7312
7313#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
7315#[cfg_attr(feature = "bindings", derive(TS))]
7316pub enum TriggerTiming {
7317 Before,
7318 After,
7319 InsteadOf,
7320}
7321
7322#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7324#[cfg_attr(feature = "bindings", derive(TS))]
7325pub enum TriggerEvent {
7326 Insert,
7327 Update(Option<Vec<Identifier>>),
7328 Delete,
7329 Truncate,
7330}
7331
7332#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
7334#[cfg_attr(feature = "bindings", derive(TS))]
7335pub enum TriggerForEach {
7336 Row,
7337 Statement,
7338}
7339
7340#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7342#[cfg_attr(feature = "bindings", derive(TS))]
7343pub enum TriggerBody {
7344 Execute {
7346 function: TableRef,
7347 args: Vec<Expression>,
7348 },
7349 Block(String),
7351}
7352
7353#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7355#[cfg_attr(feature = "bindings", derive(TS))]
7356pub struct TriggerReferencing {
7357 pub old_table: Option<Identifier>,
7358 pub new_table: Option<Identifier>,
7359 pub old_row: Option<Identifier>,
7360 pub new_row: Option<Identifier>,
7361}
7362
7363impl CreateTrigger {
7364 pub fn new(name: impl Into<String>, table: impl Into<String>) -> Self {
7365 Self {
7366 name: Identifier::new(name),
7367 table: TableRef::new(table),
7368 timing: TriggerTiming::Before,
7369 events: Vec::new(),
7370 for_each: TriggerForEach::Row,
7371 when: None,
7372 body: TriggerBody::Execute {
7373 function: TableRef::new(""),
7374 args: Vec::new(),
7375 },
7376 or_replace: false,
7377 constraint: false,
7378 deferrable: None,
7379 initially_deferred: None,
7380 referencing: None,
7381 }
7382 }
7383}
7384
7385#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7387#[cfg_attr(feature = "bindings", derive(TS))]
7388pub struct DropTrigger {
7389 pub name: Identifier,
7390 pub table: Option<TableRef>,
7391 pub if_exists: bool,
7392 pub cascade: bool,
7393}
7394
7395impl DropTrigger {
7396 pub fn new(name: impl Into<String>) -> Self {
7397 Self {
7398 name: Identifier::new(name),
7399 table: None,
7400 if_exists: false,
7401 cascade: false,
7402 }
7403 }
7404}
7405
7406#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7408#[cfg_attr(feature = "bindings", derive(TS))]
7409pub struct CreateType {
7410 pub name: TableRef,
7411 pub definition: TypeDefinition,
7412 pub if_not_exists: bool,
7413}
7414
7415#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7417#[cfg_attr(feature = "bindings", derive(TS))]
7418pub enum TypeDefinition {
7419 Enum(Vec<String>),
7421 Composite(Vec<TypeAttribute>),
7423 Range {
7425 subtype: DataType,
7426 subtype_diff: Option<String>,
7427 canonical: Option<String>,
7428 },
7429 Base {
7431 input: String,
7432 output: String,
7433 internallength: Option<i32>,
7434 },
7435 Domain {
7437 base_type: DataType,
7438 default: Option<Expression>,
7439 constraints: Vec<DomainConstraint>,
7440 },
7441}
7442
7443#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7445#[cfg_attr(feature = "bindings", derive(TS))]
7446pub struct TypeAttribute {
7447 pub name: Identifier,
7448 pub data_type: DataType,
7449 pub collate: Option<Identifier>,
7450}
7451
7452#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7454#[cfg_attr(feature = "bindings", derive(TS))]
7455pub struct DomainConstraint {
7456 pub name: Option<Identifier>,
7457 pub check: Expression,
7458}
7459
7460impl CreateType {
7461 pub fn new_enum(name: impl Into<String>, values: Vec<String>) -> Self {
7462 Self {
7463 name: TableRef::new(name),
7464 definition: TypeDefinition::Enum(values),
7465 if_not_exists: false,
7466 }
7467 }
7468
7469 pub fn new_composite(name: impl Into<String>, attributes: Vec<TypeAttribute>) -> Self {
7470 Self {
7471 name: TableRef::new(name),
7472 definition: TypeDefinition::Composite(attributes),
7473 if_not_exists: false,
7474 }
7475 }
7476}
7477
7478#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7480#[cfg_attr(feature = "bindings", derive(TS))]
7481pub struct DropType {
7482 pub name: TableRef,
7483 pub if_exists: bool,
7484 pub cascade: bool,
7485}
7486
7487impl DropType {
7488 pub fn new(name: impl Into<String>) -> Self {
7489 Self {
7490 name: TableRef::new(name),
7491 if_exists: false,
7492 cascade: false,
7493 }
7494 }
7495}
7496
7497#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7499#[cfg_attr(feature = "bindings", derive(TS))]
7500pub struct Describe {
7501 pub target: Expression,
7503 pub extended: bool,
7505 pub formatted: bool,
7507 #[serde(default)]
7509 pub kind: Option<String>,
7510 #[serde(default)]
7512 pub properties: Vec<(String, String)>,
7513 #[serde(default, skip_serializing_if = "Option::is_none")]
7515 pub style: Option<String>,
7516 #[serde(default)]
7518 pub partition: Option<Box<Expression>>,
7519 #[serde(default)]
7521 pub leading_comments: Vec<String>,
7522 #[serde(default)]
7524 pub as_json: bool,
7525}
7526
7527impl Describe {
7528 pub fn new(target: Expression) -> Self {
7529 Self {
7530 target,
7531 extended: false,
7532 formatted: false,
7533 kind: None,
7534 properties: Vec::new(),
7535 style: None,
7536 partition: None,
7537 leading_comments: Vec::new(),
7538 as_json: false,
7539 }
7540 }
7541}
7542
7543#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7545#[cfg_attr(feature = "bindings", derive(TS))]
7546pub struct Show {
7547 pub this: String,
7549 #[serde(default)]
7551 pub terse: bool,
7552 #[serde(default)]
7554 pub history: bool,
7555 pub like: Option<Expression>,
7557 pub scope_kind: Option<String>,
7559 pub scope: Option<Expression>,
7561 pub starts_with: Option<Expression>,
7563 pub limit: Option<Box<Limit>>,
7565 pub from: Option<Expression>,
7567 #[serde(default, skip_serializing_if = "Option::is_none")]
7569 pub where_clause: Option<Expression>,
7570 #[serde(default, skip_serializing_if = "Option::is_none")]
7572 pub for_target: Option<Expression>,
7573 #[serde(default, skip_serializing_if = "Option::is_none")]
7575 pub db: Option<Expression>,
7576 #[serde(default, skip_serializing_if = "Option::is_none")]
7578 pub target: Option<Expression>,
7579 #[serde(default, skip_serializing_if = "Option::is_none")]
7581 pub mutex: Option<bool>,
7582 #[serde(default, skip_serializing_if = "Vec::is_empty")]
7584 pub privileges: Vec<String>,
7585}
7586
7587impl Show {
7588 pub fn new(this: impl Into<String>) -> Self {
7589 Self {
7590 this: this.into(),
7591 terse: false,
7592 history: false,
7593 like: None,
7594 scope_kind: None,
7595 scope: None,
7596 starts_with: None,
7597 limit: None,
7598 from: None,
7599 where_clause: None,
7600 for_target: None,
7601 db: None,
7602 target: None,
7603 mutex: None,
7604 privileges: Vec::new(),
7605 }
7606 }
7607}
7608
7609#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7614#[cfg_attr(feature = "bindings", derive(TS))]
7615pub struct Paren {
7616 pub this: Expression,
7618 #[serde(default)]
7619 pub trailing_comments: Vec<String>,
7620}
7621
7622#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7624#[cfg_attr(feature = "bindings", derive(TS))]
7625pub struct Annotated {
7626 pub this: Expression,
7627 pub trailing_comments: Vec<String>,
7628}
7629
7630#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7635#[cfg_attr(feature = "bindings", derive(TS))]
7636pub struct Refresh {
7637 pub this: Box<Expression>,
7638 pub kind: String,
7639}
7640
7641#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7643#[cfg_attr(feature = "bindings", derive(TS))]
7644pub struct LockingStatement {
7645 pub this: Box<Expression>,
7646 pub expression: Box<Expression>,
7647}
7648
7649#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7651#[cfg_attr(feature = "bindings", derive(TS))]
7652pub struct SequenceProperties {
7653 #[serde(default)]
7654 pub increment: Option<Box<Expression>>,
7655 #[serde(default)]
7656 pub minvalue: Option<Box<Expression>>,
7657 #[serde(default)]
7658 pub maxvalue: Option<Box<Expression>>,
7659 #[serde(default)]
7660 pub cache: Option<Box<Expression>>,
7661 #[serde(default)]
7662 pub start: Option<Box<Expression>>,
7663 #[serde(default)]
7664 pub owned: Option<Box<Expression>>,
7665 #[serde(default)]
7666 pub options: Vec<Expression>,
7667}
7668
7669#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7671#[cfg_attr(feature = "bindings", derive(TS))]
7672pub struct TruncateTable {
7673 #[serde(default)]
7674 pub expressions: Vec<Expression>,
7675 #[serde(default)]
7676 pub is_database: Option<Box<Expression>>,
7677 #[serde(default)]
7678 pub exists: bool,
7679 #[serde(default)]
7680 pub only: Option<Box<Expression>>,
7681 #[serde(default)]
7682 pub cluster: Option<Box<Expression>>,
7683 #[serde(default)]
7684 pub identity: Option<Box<Expression>>,
7685 #[serde(default)]
7686 pub option: Option<Box<Expression>>,
7687 #[serde(default)]
7688 pub partition: Option<Box<Expression>>,
7689}
7690
7691#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7693#[cfg_attr(feature = "bindings", derive(TS))]
7694pub struct Clone {
7695 pub this: Box<Expression>,
7696 #[serde(default)]
7697 pub shallow: Option<Box<Expression>>,
7698 #[serde(default)]
7699 pub copy: Option<Box<Expression>>,
7700}
7701
7702#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7704#[cfg_attr(feature = "bindings", derive(TS))]
7705pub struct Attach {
7706 pub this: Box<Expression>,
7707 #[serde(default)]
7708 pub exists: bool,
7709 #[serde(default)]
7710 pub expressions: Vec<Expression>,
7711}
7712
7713#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7715#[cfg_attr(feature = "bindings", derive(TS))]
7716pub struct Detach {
7717 pub this: Box<Expression>,
7718 #[serde(default)]
7719 pub exists: bool,
7720}
7721
7722#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7724#[cfg_attr(feature = "bindings", derive(TS))]
7725pub struct Install {
7726 pub this: Box<Expression>,
7727 #[serde(default)]
7728 pub from_: Option<Box<Expression>>,
7729 #[serde(default)]
7730 pub force: Option<Box<Expression>>,
7731}
7732
7733#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7735#[cfg_attr(feature = "bindings", derive(TS))]
7736pub struct Summarize {
7737 pub this: Box<Expression>,
7738 #[serde(default)]
7739 pub table: Option<Box<Expression>>,
7740}
7741
7742#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7744#[cfg_attr(feature = "bindings", derive(TS))]
7745pub struct Declare {
7746 #[serde(default)]
7747 pub expressions: Vec<Expression>,
7748}
7749
7750#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7752#[cfg_attr(feature = "bindings", derive(TS))]
7753pub struct DeclareItem {
7754 pub this: Box<Expression>,
7755 #[serde(default)]
7756 pub kind: Option<String>,
7757 #[serde(default)]
7758 pub default: Option<Box<Expression>>,
7759 #[serde(default)]
7760 pub has_as: bool,
7761 #[serde(default, skip_serializing_if = "Vec::is_empty")]
7763 pub additional_names: Vec<Expression>,
7764}
7765
7766#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7768#[cfg_attr(feature = "bindings", derive(TS))]
7769pub struct Set {
7770 #[serde(default)]
7771 pub expressions: Vec<Expression>,
7772 #[serde(default)]
7773 pub unset: Option<Box<Expression>>,
7774 #[serde(default)]
7775 pub tag: Option<Box<Expression>>,
7776}
7777
7778#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7780#[cfg_attr(feature = "bindings", derive(TS))]
7781pub struct Heredoc {
7782 pub this: Box<Expression>,
7783 #[serde(default)]
7784 pub tag: Option<Box<Expression>>,
7785}
7786
7787#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7789#[cfg_attr(feature = "bindings", derive(TS))]
7790pub struct QueryBand {
7791 pub this: Box<Expression>,
7792 #[serde(default)]
7793 pub scope: Option<Box<Expression>>,
7794 #[serde(default)]
7795 pub update: Option<Box<Expression>>,
7796}
7797
7798#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7800#[cfg_attr(feature = "bindings", derive(TS))]
7801pub struct UserDefinedFunction {
7802 pub this: Box<Expression>,
7803 #[serde(default)]
7804 pub expressions: Vec<Expression>,
7805 #[serde(default)]
7806 pub wrapped: Option<Box<Expression>>,
7807}
7808
7809#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7811#[cfg_attr(feature = "bindings", derive(TS))]
7812pub struct RecursiveWithSearch {
7813 pub kind: String,
7814 pub this: Box<Expression>,
7815 pub expression: Box<Expression>,
7816 #[serde(default)]
7817 pub using: Option<Box<Expression>>,
7818}
7819
7820#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7822#[cfg_attr(feature = "bindings", derive(TS))]
7823pub struct ProjectionDef {
7824 pub this: Box<Expression>,
7825 pub expression: Box<Expression>,
7826}
7827
7828#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7830#[cfg_attr(feature = "bindings", derive(TS))]
7831pub struct TableAlias {
7832 #[serde(default)]
7833 pub this: Option<Box<Expression>>,
7834 #[serde(default)]
7835 pub columns: Vec<Expression>,
7836}
7837
7838#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7840#[cfg_attr(feature = "bindings", derive(TS))]
7841pub struct ByteString {
7842 pub this: Box<Expression>,
7843 #[serde(default)]
7844 pub is_bytes: Option<Box<Expression>>,
7845}
7846
7847#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7850#[cfg_attr(feature = "bindings", derive(TS))]
7851pub struct HexStringExpr {
7852 pub this: Box<Expression>,
7853 #[serde(default)]
7854 pub is_integer: Option<bool>,
7855}
7856
7857#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7859#[cfg_attr(feature = "bindings", derive(TS))]
7860pub struct UnicodeString {
7861 pub this: Box<Expression>,
7862 #[serde(default)]
7863 pub escape: Option<Box<Expression>>,
7864}
7865
7866#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7868#[cfg_attr(feature = "bindings", derive(TS))]
7869pub struct AlterColumn {
7870 pub this: Box<Expression>,
7871 #[serde(default)]
7872 pub dtype: Option<Box<Expression>>,
7873 #[serde(default)]
7874 pub collate: Option<Box<Expression>>,
7875 #[serde(default)]
7876 pub using: Option<Box<Expression>>,
7877 #[serde(default)]
7878 pub default: Option<Box<Expression>>,
7879 #[serde(default)]
7880 pub drop: Option<Box<Expression>>,
7881 #[serde(default)]
7882 pub comment: Option<Box<Expression>>,
7883 #[serde(default)]
7884 pub allow_null: Option<Box<Expression>>,
7885 #[serde(default)]
7886 pub visible: Option<Box<Expression>>,
7887 #[serde(default)]
7888 pub rename_to: Option<Box<Expression>>,
7889}
7890
7891#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7893#[cfg_attr(feature = "bindings", derive(TS))]
7894pub struct AlterSortKey {
7895 #[serde(default)]
7896 pub this: Option<Box<Expression>>,
7897 #[serde(default)]
7898 pub expressions: Vec<Expression>,
7899 #[serde(default)]
7900 pub compound: Option<Box<Expression>>,
7901}
7902
7903#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7905#[cfg_attr(feature = "bindings", derive(TS))]
7906pub struct AlterSet {
7907 #[serde(default)]
7908 pub expressions: Vec<Expression>,
7909 #[serde(default)]
7910 pub option: Option<Box<Expression>>,
7911 #[serde(default)]
7912 pub tablespace: Option<Box<Expression>>,
7913 #[serde(default)]
7914 pub access_method: Option<Box<Expression>>,
7915 #[serde(default)]
7916 pub file_format: Option<Box<Expression>>,
7917 #[serde(default)]
7918 pub copy_options: Option<Box<Expression>>,
7919 #[serde(default)]
7920 pub tag: Option<Box<Expression>>,
7921 #[serde(default)]
7922 pub location: Option<Box<Expression>>,
7923 #[serde(default)]
7924 pub serde: Option<Box<Expression>>,
7925}
7926
7927#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7929#[cfg_attr(feature = "bindings", derive(TS))]
7930pub struct RenameColumn {
7931 pub this: Box<Expression>,
7932 #[serde(default)]
7933 pub to: Option<Box<Expression>>,
7934 #[serde(default)]
7935 pub exists: bool,
7936}
7937
7938#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7940#[cfg_attr(feature = "bindings", derive(TS))]
7941pub struct Comprehension {
7942 pub this: Box<Expression>,
7943 pub expression: Box<Expression>,
7944 #[serde(default)]
7945 pub position: Option<Box<Expression>>,
7946 #[serde(default)]
7947 pub iterator: Option<Box<Expression>>,
7948 #[serde(default)]
7949 pub condition: Option<Box<Expression>>,
7950}
7951
7952#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7954#[cfg_attr(feature = "bindings", derive(TS))]
7955pub struct MergeTreeTTLAction {
7956 pub this: Box<Expression>,
7957 #[serde(default)]
7958 pub delete: Option<Box<Expression>>,
7959 #[serde(default)]
7960 pub recompress: Option<Box<Expression>>,
7961 #[serde(default)]
7962 pub to_disk: Option<Box<Expression>>,
7963 #[serde(default)]
7964 pub to_volume: Option<Box<Expression>>,
7965}
7966
7967#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7969#[cfg_attr(feature = "bindings", derive(TS))]
7970pub struct MergeTreeTTL {
7971 #[serde(default)]
7972 pub expressions: Vec<Expression>,
7973 #[serde(default)]
7974 pub where_: Option<Box<Expression>>,
7975 #[serde(default)]
7976 pub group: Option<Box<Expression>>,
7977 #[serde(default)]
7978 pub aggregates: Option<Box<Expression>>,
7979}
7980
7981#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7983#[cfg_attr(feature = "bindings", derive(TS))]
7984pub struct IndexConstraintOption {
7985 #[serde(default)]
7986 pub key_block_size: Option<Box<Expression>>,
7987 #[serde(default)]
7988 pub using: Option<Box<Expression>>,
7989 #[serde(default)]
7990 pub parser: Option<Box<Expression>>,
7991 #[serde(default)]
7992 pub comment: Option<Box<Expression>>,
7993 #[serde(default)]
7994 pub visible: Option<Box<Expression>>,
7995 #[serde(default)]
7996 pub engine_attr: Option<Box<Expression>>,
7997 #[serde(default)]
7998 pub secondary_engine_attr: Option<Box<Expression>>,
7999}
8000
8001#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8003#[cfg_attr(feature = "bindings", derive(TS))]
8004pub struct PeriodForSystemTimeConstraint {
8005 pub this: Box<Expression>,
8006 pub expression: Box<Expression>,
8007}
8008
8009#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8011#[cfg_attr(feature = "bindings", derive(TS))]
8012pub struct CaseSpecificColumnConstraint {
8013 #[serde(default)]
8014 pub not_: Option<Box<Expression>>,
8015}
8016
8017#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8019#[cfg_attr(feature = "bindings", derive(TS))]
8020pub struct CharacterSetColumnConstraint {
8021 pub this: Box<Expression>,
8022}
8023
8024#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8026#[cfg_attr(feature = "bindings", derive(TS))]
8027pub struct CheckColumnConstraint {
8028 pub this: Box<Expression>,
8029 #[serde(default)]
8030 pub enforced: Option<Box<Expression>>,
8031}
8032
8033#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8035#[cfg_attr(feature = "bindings", derive(TS))]
8036pub struct CompressColumnConstraint {
8037 #[serde(default)]
8038 pub this: Option<Box<Expression>>,
8039}
8040
8041#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8043#[cfg_attr(feature = "bindings", derive(TS))]
8044pub struct DateFormatColumnConstraint {
8045 pub this: Box<Expression>,
8046}
8047
8048#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8050#[cfg_attr(feature = "bindings", derive(TS))]
8051pub struct EphemeralColumnConstraint {
8052 #[serde(default)]
8053 pub this: Option<Box<Expression>>,
8054}
8055
8056#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8058#[cfg_attr(feature = "bindings", derive(TS))]
8059pub struct WithOperator {
8060 pub this: Box<Expression>,
8061 pub op: String,
8062}
8063
8064#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8066#[cfg_attr(feature = "bindings", derive(TS))]
8067pub struct GeneratedAsIdentityColumnConstraint {
8068 #[serde(default)]
8069 pub this: Option<Box<Expression>>,
8070 #[serde(default)]
8071 pub expression: Option<Box<Expression>>,
8072 #[serde(default)]
8073 pub on_null: Option<Box<Expression>>,
8074 #[serde(default)]
8075 pub start: Option<Box<Expression>>,
8076 #[serde(default)]
8077 pub increment: Option<Box<Expression>>,
8078 #[serde(default)]
8079 pub minvalue: Option<Box<Expression>>,
8080 #[serde(default)]
8081 pub maxvalue: Option<Box<Expression>>,
8082 #[serde(default)]
8083 pub cycle: Option<Box<Expression>>,
8084 #[serde(default)]
8085 pub order: Option<Box<Expression>>,
8086}
8087
8088#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8091#[cfg_attr(feature = "bindings", derive(TS))]
8092pub struct AutoIncrementColumnConstraint;
8093
8094#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8096#[cfg_attr(feature = "bindings", derive(TS))]
8097pub struct CommentColumnConstraint;
8098
8099#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8101#[cfg_attr(feature = "bindings", derive(TS))]
8102pub struct GeneratedAsRowColumnConstraint {
8103 #[serde(default)]
8104 pub start: Option<Box<Expression>>,
8105 #[serde(default)]
8106 pub hidden: Option<Box<Expression>>,
8107}
8108
8109#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8111#[cfg_attr(feature = "bindings", derive(TS))]
8112pub struct IndexColumnConstraint {
8113 #[serde(default)]
8114 pub this: Option<Box<Expression>>,
8115 #[serde(default)]
8116 pub expressions: Vec<Expression>,
8117 #[serde(default)]
8118 pub kind: Option<String>,
8119 #[serde(default)]
8120 pub index_type: Option<Box<Expression>>,
8121 #[serde(default)]
8122 pub options: Vec<Expression>,
8123 #[serde(default)]
8124 pub expression: Option<Box<Expression>>,
8125 #[serde(default)]
8126 pub granularity: Option<Box<Expression>>,
8127}
8128
8129#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8131#[cfg_attr(feature = "bindings", derive(TS))]
8132pub struct MaskingPolicyColumnConstraint {
8133 pub this: Box<Expression>,
8134 #[serde(default)]
8135 pub expressions: Vec<Expression>,
8136}
8137
8138#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8140#[cfg_attr(feature = "bindings", derive(TS))]
8141pub struct NotNullColumnConstraint {
8142 #[serde(default)]
8143 pub allow_null: Option<Box<Expression>>,
8144}
8145
8146#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8148#[cfg_attr(feature = "bindings", derive(TS))]
8149pub struct DefaultColumnConstraint {
8150 pub this: Box<Expression>,
8151}
8152
8153#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8155#[cfg_attr(feature = "bindings", derive(TS))]
8156pub struct PrimaryKeyColumnConstraint {
8157 #[serde(default)]
8158 pub desc: Option<Box<Expression>>,
8159 #[serde(default)]
8160 pub options: Vec<Expression>,
8161}
8162
8163#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8165#[cfg_attr(feature = "bindings", derive(TS))]
8166pub struct UniqueColumnConstraint {
8167 #[serde(default)]
8168 pub this: Option<Box<Expression>>,
8169 #[serde(default)]
8170 pub index_type: Option<Box<Expression>>,
8171 #[serde(default)]
8172 pub on_conflict: Option<Box<Expression>>,
8173 #[serde(default)]
8174 pub nulls: Option<Box<Expression>>,
8175 #[serde(default)]
8176 pub options: Vec<Expression>,
8177}
8178
8179#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8181#[cfg_attr(feature = "bindings", derive(TS))]
8182pub struct WatermarkColumnConstraint {
8183 pub this: Box<Expression>,
8184 pub expression: Box<Expression>,
8185}
8186
8187#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8189#[cfg_attr(feature = "bindings", derive(TS))]
8190pub struct ComputedColumnConstraint {
8191 pub this: Box<Expression>,
8192 #[serde(default)]
8193 pub persisted: Option<Box<Expression>>,
8194 #[serde(default)]
8195 pub not_null: Option<Box<Expression>>,
8196 #[serde(default)]
8197 pub data_type: Option<Box<Expression>>,
8198}
8199
8200#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8202#[cfg_attr(feature = "bindings", derive(TS))]
8203pub struct InOutColumnConstraint {
8204 #[serde(default)]
8205 pub input_: Option<Box<Expression>>,
8206 #[serde(default)]
8207 pub output: Option<Box<Expression>>,
8208}
8209
8210#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8212#[cfg_attr(feature = "bindings", derive(TS))]
8213pub struct PathColumnConstraint {
8214 pub this: Box<Expression>,
8215}
8216
8217#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8219#[cfg_attr(feature = "bindings", derive(TS))]
8220pub struct Constraint {
8221 pub this: Box<Expression>,
8222 #[serde(default)]
8223 pub expressions: Vec<Expression>,
8224}
8225
8226#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8228#[cfg_attr(feature = "bindings", derive(TS))]
8229pub struct Export {
8230 pub this: Box<Expression>,
8231 #[serde(default)]
8232 pub connection: Option<Box<Expression>>,
8233 #[serde(default)]
8234 pub options: Vec<Expression>,
8235}
8236
8237#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8239#[cfg_attr(feature = "bindings", derive(TS))]
8240pub struct Filter {
8241 pub this: Box<Expression>,
8242 pub expression: Box<Expression>,
8243}
8244
8245#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8247#[cfg_attr(feature = "bindings", derive(TS))]
8248pub struct Changes {
8249 #[serde(default)]
8250 pub information: Option<Box<Expression>>,
8251 #[serde(default)]
8252 pub at_before: Option<Box<Expression>>,
8253 #[serde(default)]
8254 pub end: Option<Box<Expression>>,
8255}
8256
8257#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8259#[cfg_attr(feature = "bindings", derive(TS))]
8260pub struct Directory {
8261 pub this: Box<Expression>,
8262 #[serde(default)]
8263 pub local: Option<Box<Expression>>,
8264 #[serde(default)]
8265 pub row_format: Option<Box<Expression>>,
8266}
8267
8268#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8270#[cfg_attr(feature = "bindings", derive(TS))]
8271pub struct ForeignKey {
8272 #[serde(default)]
8273 pub expressions: Vec<Expression>,
8274 #[serde(default)]
8275 pub reference: Option<Box<Expression>>,
8276 #[serde(default)]
8277 pub delete: Option<Box<Expression>>,
8278 #[serde(default)]
8279 pub update: Option<Box<Expression>>,
8280 #[serde(default)]
8281 pub options: Vec<Expression>,
8282}
8283
8284#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8286#[cfg_attr(feature = "bindings", derive(TS))]
8287pub struct ColumnPrefix {
8288 pub this: Box<Expression>,
8289 pub expression: Box<Expression>,
8290}
8291
8292#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8294#[cfg_attr(feature = "bindings", derive(TS))]
8295pub struct PrimaryKey {
8296 #[serde(default)]
8297 pub this: Option<Box<Expression>>,
8298 #[serde(default)]
8299 pub expressions: Vec<Expression>,
8300 #[serde(default)]
8301 pub options: Vec<Expression>,
8302 #[serde(default)]
8303 pub include: Option<Box<Expression>>,
8304}
8305
8306#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8308#[cfg_attr(feature = "bindings", derive(TS))]
8309pub struct IntoClause {
8310 #[serde(default)]
8311 pub this: Option<Box<Expression>>,
8312 #[serde(default)]
8313 pub temporary: bool,
8314 #[serde(default)]
8315 pub unlogged: Option<Box<Expression>>,
8316 #[serde(default)]
8317 pub bulk_collect: Option<Box<Expression>>,
8318 #[serde(default)]
8319 pub expressions: Vec<Expression>,
8320}
8321
8322#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8324#[cfg_attr(feature = "bindings", derive(TS))]
8325pub struct JoinHint {
8326 pub this: Box<Expression>,
8327 #[serde(default)]
8328 pub expressions: Vec<Expression>,
8329}
8330
8331#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8333#[cfg_attr(feature = "bindings", derive(TS))]
8334pub struct Opclass {
8335 pub this: Box<Expression>,
8336 pub expression: Box<Expression>,
8337}
8338
8339#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8341#[cfg_attr(feature = "bindings", derive(TS))]
8342pub struct Index {
8343 #[serde(default)]
8344 pub this: Option<Box<Expression>>,
8345 #[serde(default)]
8346 pub table: Option<Box<Expression>>,
8347 #[serde(default)]
8348 pub unique: bool,
8349 #[serde(default)]
8350 pub primary: Option<Box<Expression>>,
8351 #[serde(default)]
8352 pub amp: Option<Box<Expression>>,
8353 #[serde(default)]
8354 pub params: Vec<Expression>,
8355}
8356
8357#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8359#[cfg_attr(feature = "bindings", derive(TS))]
8360pub struct IndexParameters {
8361 #[serde(default)]
8362 pub using: Option<Box<Expression>>,
8363 #[serde(default)]
8364 pub include: Option<Box<Expression>>,
8365 #[serde(default)]
8366 pub columns: Vec<Expression>,
8367 #[serde(default)]
8368 pub with_storage: Option<Box<Expression>>,
8369 #[serde(default)]
8370 pub partition_by: Option<Box<Expression>>,
8371 #[serde(default)]
8372 pub tablespace: Option<Box<Expression>>,
8373 #[serde(default)]
8374 pub where_: Option<Box<Expression>>,
8375 #[serde(default)]
8376 pub on: Option<Box<Expression>>,
8377}
8378
8379#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8381#[cfg_attr(feature = "bindings", derive(TS))]
8382pub struct ConditionalInsert {
8383 pub this: Box<Expression>,
8384 #[serde(default)]
8385 pub expression: Option<Box<Expression>>,
8386 #[serde(default)]
8387 pub else_: Option<Box<Expression>>,
8388}
8389
8390#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8392#[cfg_attr(feature = "bindings", derive(TS))]
8393pub struct MultitableInserts {
8394 #[serde(default)]
8395 pub expressions: Vec<Expression>,
8396 pub kind: String,
8397 #[serde(default)]
8398 pub source: Option<Box<Expression>>,
8399 #[serde(default)]
8401 pub leading_comments: Vec<String>,
8402}
8403
8404#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8406#[cfg_attr(feature = "bindings", derive(TS))]
8407pub struct OnConflict {
8408 #[serde(default)]
8409 pub duplicate: Option<Box<Expression>>,
8410 #[serde(default)]
8411 pub expressions: Vec<Expression>,
8412 #[serde(default)]
8413 pub action: Option<Box<Expression>>,
8414 #[serde(default)]
8415 pub conflict_keys: Option<Box<Expression>>,
8416 #[serde(default)]
8417 pub index_predicate: Option<Box<Expression>>,
8418 #[serde(default)]
8419 pub constraint: Option<Box<Expression>>,
8420 #[serde(default)]
8421 pub where_: Option<Box<Expression>>,
8422}
8423
8424#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8426#[cfg_attr(feature = "bindings", derive(TS))]
8427pub struct OnCondition {
8428 #[serde(default)]
8429 pub error: Option<Box<Expression>>,
8430 #[serde(default)]
8431 pub empty: Option<Box<Expression>>,
8432 #[serde(default)]
8433 pub null: Option<Box<Expression>>,
8434}
8435
8436#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8438#[cfg_attr(feature = "bindings", derive(TS))]
8439pub struct Returning {
8440 #[serde(default)]
8441 pub expressions: Vec<Expression>,
8442 #[serde(default)]
8443 pub into: Option<Box<Expression>>,
8444}
8445
8446#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8448#[cfg_attr(feature = "bindings", derive(TS))]
8449pub struct Introducer {
8450 pub this: Box<Expression>,
8451 pub expression: Box<Expression>,
8452}
8453
8454#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8456#[cfg_attr(feature = "bindings", derive(TS))]
8457pub struct PartitionRange {
8458 pub this: Box<Expression>,
8459 #[serde(default)]
8460 pub expression: Option<Box<Expression>>,
8461 #[serde(default)]
8462 pub expressions: Vec<Expression>,
8463}
8464
8465#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8467#[cfg_attr(feature = "bindings", derive(TS))]
8468pub struct Group {
8469 #[serde(default)]
8470 pub expressions: Vec<Expression>,
8471 #[serde(default)]
8472 pub grouping_sets: Option<Box<Expression>>,
8473 #[serde(default)]
8474 pub cube: Option<Box<Expression>>,
8475 #[serde(default)]
8476 pub rollup: Option<Box<Expression>>,
8477 #[serde(default)]
8478 pub totals: Option<Box<Expression>>,
8479 #[serde(default)]
8481 pub all: Option<bool>,
8482}
8483
8484#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8486#[cfg_attr(feature = "bindings", derive(TS))]
8487pub struct Cube {
8488 #[serde(default)]
8489 pub expressions: Vec<Expression>,
8490}
8491
8492#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8494#[cfg_attr(feature = "bindings", derive(TS))]
8495pub struct Rollup {
8496 #[serde(default)]
8497 pub expressions: Vec<Expression>,
8498}
8499
8500#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8502#[cfg_attr(feature = "bindings", derive(TS))]
8503pub struct GroupingSets {
8504 #[serde(default)]
8505 pub expressions: Vec<Expression>,
8506}
8507
8508#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8510#[cfg_attr(feature = "bindings", derive(TS))]
8511pub struct LimitOptions {
8512 #[serde(default)]
8513 pub percent: Option<Box<Expression>>,
8514 #[serde(default)]
8515 pub rows: Option<Box<Expression>>,
8516 #[serde(default)]
8517 pub with_ties: Option<Box<Expression>>,
8518}
8519
8520#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8522#[cfg_attr(feature = "bindings", derive(TS))]
8523pub struct Lateral {
8524 pub this: Box<Expression>,
8525 #[serde(default)]
8526 pub view: Option<Box<Expression>>,
8527 #[serde(default)]
8528 pub outer: Option<Box<Expression>>,
8529 #[serde(default)]
8530 pub alias: Option<String>,
8531 #[serde(default, skip_serializing_if = "std::ops::Not::not")]
8533 pub alias_quoted: bool,
8534 #[serde(default)]
8535 pub cross_apply: Option<Box<Expression>>,
8536 #[serde(default)]
8537 pub ordinality: Option<Box<Expression>>,
8538 #[serde(default, skip_serializing_if = "Vec::is_empty")]
8540 pub column_aliases: Vec<String>,
8541}
8542
8543#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8545#[cfg_attr(feature = "bindings", derive(TS))]
8546pub struct TableFromRows {
8547 pub this: Box<Expression>,
8548 #[serde(default)]
8549 pub alias: Option<String>,
8550 #[serde(default)]
8551 pub joins: Vec<Expression>,
8552 #[serde(default)]
8553 pub pivots: Option<Box<Expression>>,
8554 #[serde(default)]
8555 pub sample: Option<Box<Expression>>,
8556}
8557
8558#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8561#[cfg_attr(feature = "bindings", derive(TS))]
8562pub struct RowsFrom {
8563 pub expressions: Vec<Expression>,
8565 #[serde(default)]
8567 pub ordinality: bool,
8568 #[serde(default)]
8570 pub alias: Option<Box<Expression>>,
8571}
8572
8573#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8575#[cfg_attr(feature = "bindings", derive(TS))]
8576pub struct WithFill {
8577 #[serde(default)]
8578 pub from_: Option<Box<Expression>>,
8579 #[serde(default)]
8580 pub to: Option<Box<Expression>>,
8581 #[serde(default)]
8582 pub step: Option<Box<Expression>>,
8583 #[serde(default)]
8584 pub staleness: Option<Box<Expression>>,
8585 #[serde(default)]
8586 pub interpolate: Option<Box<Expression>>,
8587}
8588
8589#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8591#[cfg_attr(feature = "bindings", derive(TS))]
8592pub struct Property {
8593 pub this: Box<Expression>,
8594 #[serde(default)]
8595 pub value: Option<Box<Expression>>,
8596}
8597
8598#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8600#[cfg_attr(feature = "bindings", derive(TS))]
8601pub struct GrantPrivilege {
8602 pub this: Box<Expression>,
8603 #[serde(default)]
8604 pub expressions: Vec<Expression>,
8605}
8606
8607#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8609#[cfg_attr(feature = "bindings", derive(TS))]
8610pub struct AllowedValuesProperty {
8611 #[serde(default)]
8612 pub expressions: Vec<Expression>,
8613}
8614
8615#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8617#[cfg_attr(feature = "bindings", derive(TS))]
8618pub struct AlgorithmProperty {
8619 pub this: Box<Expression>,
8620}
8621
8622#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8624#[cfg_attr(feature = "bindings", derive(TS))]
8625pub struct AutoIncrementProperty {
8626 pub this: Box<Expression>,
8627}
8628
8629#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8631#[cfg_attr(feature = "bindings", derive(TS))]
8632pub struct AutoRefreshProperty {
8633 pub this: Box<Expression>,
8634}
8635
8636#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8638#[cfg_attr(feature = "bindings", derive(TS))]
8639pub struct BackupProperty {
8640 pub this: Box<Expression>,
8641}
8642
8643#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8645#[cfg_attr(feature = "bindings", derive(TS))]
8646pub struct BuildProperty {
8647 pub this: Box<Expression>,
8648}
8649
8650#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8652#[cfg_attr(feature = "bindings", derive(TS))]
8653pub struct BlockCompressionProperty {
8654 #[serde(default)]
8655 pub autotemp: Option<Box<Expression>>,
8656 #[serde(default)]
8657 pub always: Option<Box<Expression>>,
8658 #[serde(default)]
8659 pub default: Option<Box<Expression>>,
8660 #[serde(default)]
8661 pub manual: Option<Box<Expression>>,
8662 #[serde(default)]
8663 pub never: Option<Box<Expression>>,
8664}
8665
8666#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8668#[cfg_attr(feature = "bindings", derive(TS))]
8669pub struct CharacterSetProperty {
8670 pub this: Box<Expression>,
8671 #[serde(default)]
8672 pub default: Option<Box<Expression>>,
8673}
8674
8675#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8677#[cfg_attr(feature = "bindings", derive(TS))]
8678pub struct ChecksumProperty {
8679 #[serde(default)]
8680 pub on: Option<Box<Expression>>,
8681 #[serde(default)]
8682 pub default: Option<Box<Expression>>,
8683}
8684
8685#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8687#[cfg_attr(feature = "bindings", derive(TS))]
8688pub struct CollateProperty {
8689 pub this: Box<Expression>,
8690 #[serde(default)]
8691 pub default: Option<Box<Expression>>,
8692}
8693
8694#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8696#[cfg_attr(feature = "bindings", derive(TS))]
8697pub struct DataBlocksizeProperty {
8698 #[serde(default)]
8699 pub size: Option<i64>,
8700 #[serde(default)]
8701 pub units: Option<Box<Expression>>,
8702 #[serde(default)]
8703 pub minimum: Option<Box<Expression>>,
8704 #[serde(default)]
8705 pub maximum: Option<Box<Expression>>,
8706 #[serde(default)]
8707 pub default: Option<Box<Expression>>,
8708}
8709
8710#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8712#[cfg_attr(feature = "bindings", derive(TS))]
8713pub struct DataDeletionProperty {
8714 pub on: Box<Expression>,
8715 #[serde(default)]
8716 pub filter_column: Option<Box<Expression>>,
8717 #[serde(default)]
8718 pub retention_period: Option<Box<Expression>>,
8719}
8720
8721#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8723#[cfg_attr(feature = "bindings", derive(TS))]
8724pub struct DefinerProperty {
8725 pub this: Box<Expression>,
8726}
8727
8728#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8730#[cfg_attr(feature = "bindings", derive(TS))]
8731pub struct DistKeyProperty {
8732 pub this: Box<Expression>,
8733}
8734
8735#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8737#[cfg_attr(feature = "bindings", derive(TS))]
8738pub struct DistributedByProperty {
8739 #[serde(default)]
8740 pub expressions: Vec<Expression>,
8741 pub kind: String,
8742 #[serde(default)]
8743 pub buckets: Option<Box<Expression>>,
8744 #[serde(default)]
8745 pub order: Option<Box<Expression>>,
8746}
8747
8748#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8750#[cfg_attr(feature = "bindings", derive(TS))]
8751pub struct DistStyleProperty {
8752 pub this: Box<Expression>,
8753}
8754
8755#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8757#[cfg_attr(feature = "bindings", derive(TS))]
8758pub struct DuplicateKeyProperty {
8759 #[serde(default)]
8760 pub expressions: Vec<Expression>,
8761}
8762
8763#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8765#[cfg_attr(feature = "bindings", derive(TS))]
8766pub struct EngineProperty {
8767 pub this: Box<Expression>,
8768}
8769
8770#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8772#[cfg_attr(feature = "bindings", derive(TS))]
8773pub struct ToTableProperty {
8774 pub this: Box<Expression>,
8775}
8776
8777#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8779#[cfg_attr(feature = "bindings", derive(TS))]
8780pub struct ExecuteAsProperty {
8781 pub this: Box<Expression>,
8782}
8783
8784#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8786#[cfg_attr(feature = "bindings", derive(TS))]
8787pub struct ExternalProperty {
8788 #[serde(default)]
8789 pub this: Option<Box<Expression>>,
8790}
8791
8792#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8794#[cfg_attr(feature = "bindings", derive(TS))]
8795pub struct FallbackProperty {
8796 #[serde(default)]
8797 pub no: Option<Box<Expression>>,
8798 #[serde(default)]
8799 pub protection: Option<Box<Expression>>,
8800}
8801
8802#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8804#[cfg_attr(feature = "bindings", derive(TS))]
8805pub struct FileFormatProperty {
8806 #[serde(default)]
8807 pub this: Option<Box<Expression>>,
8808 #[serde(default)]
8809 pub expressions: Vec<Expression>,
8810 #[serde(default)]
8811 pub hive_format: Option<Box<Expression>>,
8812}
8813
8814#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8816#[cfg_attr(feature = "bindings", derive(TS))]
8817pub struct CredentialsProperty {
8818 #[serde(default)]
8819 pub expressions: Vec<Expression>,
8820}
8821
8822#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8824#[cfg_attr(feature = "bindings", derive(TS))]
8825pub struct FreespaceProperty {
8826 pub this: Box<Expression>,
8827 #[serde(default)]
8828 pub percent: Option<Box<Expression>>,
8829}
8830
8831#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8833#[cfg_attr(feature = "bindings", derive(TS))]
8834pub struct InheritsProperty {
8835 #[serde(default)]
8836 pub expressions: Vec<Expression>,
8837}
8838
8839#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8841#[cfg_attr(feature = "bindings", derive(TS))]
8842pub struct InputModelProperty {
8843 pub this: Box<Expression>,
8844}
8845
8846#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8848#[cfg_attr(feature = "bindings", derive(TS))]
8849pub struct OutputModelProperty {
8850 pub this: Box<Expression>,
8851}
8852
8853#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8855#[cfg_attr(feature = "bindings", derive(TS))]
8856pub struct IsolatedLoadingProperty {
8857 #[serde(default)]
8858 pub no: Option<Box<Expression>>,
8859 #[serde(default)]
8860 pub concurrent: Option<Box<Expression>>,
8861 #[serde(default)]
8862 pub target: Option<Box<Expression>>,
8863}
8864
8865#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8867#[cfg_attr(feature = "bindings", derive(TS))]
8868pub struct JournalProperty {
8869 #[serde(default)]
8870 pub no: Option<Box<Expression>>,
8871 #[serde(default)]
8872 pub dual: Option<Box<Expression>>,
8873 #[serde(default)]
8874 pub before: Option<Box<Expression>>,
8875 #[serde(default)]
8876 pub local: Option<Box<Expression>>,
8877 #[serde(default)]
8878 pub after: Option<Box<Expression>>,
8879}
8880
8881#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8883#[cfg_attr(feature = "bindings", derive(TS))]
8884pub struct LanguageProperty {
8885 pub this: Box<Expression>,
8886}
8887
8888#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8890#[cfg_attr(feature = "bindings", derive(TS))]
8891pub struct EnviromentProperty {
8892 #[serde(default)]
8893 pub expressions: Vec<Expression>,
8894}
8895
8896#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8898#[cfg_attr(feature = "bindings", derive(TS))]
8899pub struct ClusteredByProperty {
8900 #[serde(default)]
8901 pub expressions: Vec<Expression>,
8902 #[serde(default)]
8903 pub sorted_by: Option<Box<Expression>>,
8904 #[serde(default)]
8905 pub buckets: Option<Box<Expression>>,
8906}
8907
8908#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8910#[cfg_attr(feature = "bindings", derive(TS))]
8911pub struct DictProperty {
8912 pub this: Box<Expression>,
8913 pub kind: String,
8914 #[serde(default)]
8915 pub settings: Option<Box<Expression>>,
8916}
8917
8918#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8920#[cfg_attr(feature = "bindings", derive(TS))]
8921pub struct DictRange {
8922 pub this: Box<Expression>,
8923 #[serde(default)]
8924 pub min: Option<Box<Expression>>,
8925 #[serde(default)]
8926 pub max: Option<Box<Expression>>,
8927}
8928
8929#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8931#[cfg_attr(feature = "bindings", derive(TS))]
8932pub struct OnCluster {
8933 pub this: Box<Expression>,
8934}
8935
8936#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8938#[cfg_attr(feature = "bindings", derive(TS))]
8939pub struct LikeProperty {
8940 pub this: Box<Expression>,
8941 #[serde(default)]
8942 pub expressions: Vec<Expression>,
8943}
8944
8945#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8947#[cfg_attr(feature = "bindings", derive(TS))]
8948pub struct LocationProperty {
8949 pub this: Box<Expression>,
8950}
8951
8952#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8954#[cfg_attr(feature = "bindings", derive(TS))]
8955pub struct LockProperty {
8956 pub this: Box<Expression>,
8957}
8958
8959#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8961#[cfg_attr(feature = "bindings", derive(TS))]
8962pub struct LockingProperty {
8963 #[serde(default)]
8964 pub this: Option<Box<Expression>>,
8965 pub kind: String,
8966 #[serde(default)]
8967 pub for_or_in: Option<Box<Expression>>,
8968 #[serde(default)]
8969 pub lock_type: Option<Box<Expression>>,
8970 #[serde(default)]
8971 pub override_: Option<Box<Expression>>,
8972}
8973
8974#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8976#[cfg_attr(feature = "bindings", derive(TS))]
8977pub struct LogProperty {
8978 #[serde(default)]
8979 pub no: Option<Box<Expression>>,
8980}
8981
8982#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8984#[cfg_attr(feature = "bindings", derive(TS))]
8985pub struct MaterializedProperty {
8986 #[serde(default)]
8987 pub this: Option<Box<Expression>>,
8988}
8989
8990#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8992#[cfg_attr(feature = "bindings", derive(TS))]
8993pub struct MergeBlockRatioProperty {
8994 #[serde(default)]
8995 pub this: Option<Box<Expression>>,
8996 #[serde(default)]
8997 pub no: Option<Box<Expression>>,
8998 #[serde(default)]
8999 pub default: Option<Box<Expression>>,
9000 #[serde(default)]
9001 pub percent: Option<Box<Expression>>,
9002}
9003
9004#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9006#[cfg_attr(feature = "bindings", derive(TS))]
9007pub struct OnProperty {
9008 pub this: Box<Expression>,
9009}
9010
9011#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9013#[cfg_attr(feature = "bindings", derive(TS))]
9014pub struct OnCommitProperty {
9015 #[serde(default)]
9016 pub delete: Option<Box<Expression>>,
9017}
9018
9019#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9021#[cfg_attr(feature = "bindings", derive(TS))]
9022pub struct PartitionedByProperty {
9023 pub this: Box<Expression>,
9024}
9025
9026#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9028#[cfg_attr(feature = "bindings", derive(TS))]
9029pub struct PartitionedByBucket {
9030 pub this: Box<Expression>,
9031 pub expression: Box<Expression>,
9032}
9033
9034#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9036#[cfg_attr(feature = "bindings", derive(TS))]
9037pub struct PartitionByTruncate {
9038 pub this: Box<Expression>,
9039 pub expression: Box<Expression>,
9040}
9041
9042#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9044#[cfg_attr(feature = "bindings", derive(TS))]
9045pub struct PartitionByRangeProperty {
9046 #[serde(default)]
9047 pub partition_expressions: Option<Box<Expression>>,
9048 #[serde(default)]
9049 pub create_expressions: Option<Box<Expression>>,
9050}
9051
9052#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9054#[cfg_attr(feature = "bindings", derive(TS))]
9055pub struct PartitionByRangePropertyDynamic {
9056 #[serde(default)]
9057 pub this: Option<Box<Expression>>,
9058 #[serde(default)]
9059 pub start: Option<Box<Expression>>,
9060 #[serde(default)]
9062 pub use_start_end: bool,
9063 #[serde(default)]
9064 pub end: Option<Box<Expression>>,
9065 #[serde(default)]
9066 pub every: Option<Box<Expression>>,
9067}
9068
9069#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9071#[cfg_attr(feature = "bindings", derive(TS))]
9072pub struct PartitionByListProperty {
9073 #[serde(default)]
9074 pub partition_expressions: Option<Box<Expression>>,
9075 #[serde(default)]
9076 pub create_expressions: Option<Box<Expression>>,
9077}
9078
9079#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9081#[cfg_attr(feature = "bindings", derive(TS))]
9082pub struct PartitionList {
9083 pub this: Box<Expression>,
9084 #[serde(default)]
9085 pub expressions: Vec<Expression>,
9086}
9087
9088#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9090#[cfg_attr(feature = "bindings", derive(TS))]
9091pub struct Partition {
9092 pub expressions: Vec<Expression>,
9093 #[serde(default)]
9094 pub subpartition: bool,
9095}
9096
9097#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9100#[cfg_attr(feature = "bindings", derive(TS))]
9101pub struct RefreshTriggerProperty {
9102 pub method: String,
9104 #[serde(default)]
9106 pub kind: Option<String>,
9107 #[serde(default)]
9109 pub every: Option<Box<Expression>>,
9110 #[serde(default)]
9112 pub unit: Option<String>,
9113 #[serde(default)]
9115 pub starts: Option<Box<Expression>>,
9116}
9117
9118#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9120#[cfg_attr(feature = "bindings", derive(TS))]
9121pub struct UniqueKeyProperty {
9122 #[serde(default)]
9123 pub expressions: Vec<Expression>,
9124}
9125
9126#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9128#[cfg_attr(feature = "bindings", derive(TS))]
9129pub struct RollupProperty {
9130 pub expressions: Vec<RollupIndex>,
9131}
9132
9133#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9135#[cfg_attr(feature = "bindings", derive(TS))]
9136pub struct RollupIndex {
9137 pub name: Identifier,
9138 pub expressions: Vec<Identifier>,
9139}
9140
9141#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9143#[cfg_attr(feature = "bindings", derive(TS))]
9144pub struct PartitionBoundSpec {
9145 #[serde(default)]
9146 pub this: Option<Box<Expression>>,
9147 #[serde(default)]
9148 pub expression: Option<Box<Expression>>,
9149 #[serde(default)]
9150 pub from_expressions: Option<Box<Expression>>,
9151 #[serde(default)]
9152 pub to_expressions: Option<Box<Expression>>,
9153}
9154
9155#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9157#[cfg_attr(feature = "bindings", derive(TS))]
9158pub struct PartitionedOfProperty {
9159 pub this: Box<Expression>,
9160 pub expression: Box<Expression>,
9161}
9162
9163#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9165#[cfg_attr(feature = "bindings", derive(TS))]
9166pub struct RemoteWithConnectionModelProperty {
9167 pub this: Box<Expression>,
9168}
9169
9170#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9172#[cfg_attr(feature = "bindings", derive(TS))]
9173pub struct ReturnsProperty {
9174 #[serde(default)]
9175 pub this: Option<Box<Expression>>,
9176 #[serde(default)]
9177 pub is_table: Option<Box<Expression>>,
9178 #[serde(default)]
9179 pub table: Option<Box<Expression>>,
9180 #[serde(default)]
9181 pub null: Option<Box<Expression>>,
9182}
9183
9184#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9186#[cfg_attr(feature = "bindings", derive(TS))]
9187pub struct RowFormatProperty {
9188 pub this: Box<Expression>,
9189}
9190
9191#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9193#[cfg_attr(feature = "bindings", derive(TS))]
9194pub struct RowFormatDelimitedProperty {
9195 #[serde(default)]
9196 pub fields: Option<Box<Expression>>,
9197 #[serde(default)]
9198 pub escaped: Option<Box<Expression>>,
9199 #[serde(default)]
9200 pub collection_items: Option<Box<Expression>>,
9201 #[serde(default)]
9202 pub map_keys: Option<Box<Expression>>,
9203 #[serde(default)]
9204 pub lines: Option<Box<Expression>>,
9205 #[serde(default)]
9206 pub null: Option<Box<Expression>>,
9207 #[serde(default)]
9208 pub serde: Option<Box<Expression>>,
9209}
9210
9211#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9213#[cfg_attr(feature = "bindings", derive(TS))]
9214pub struct RowFormatSerdeProperty {
9215 pub this: Box<Expression>,
9216 #[serde(default)]
9217 pub serde_properties: Option<Box<Expression>>,
9218}
9219
9220#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9222#[cfg_attr(feature = "bindings", derive(TS))]
9223pub struct QueryTransform {
9224 #[serde(default)]
9225 pub expressions: Vec<Expression>,
9226 #[serde(default)]
9227 pub command_script: Option<Box<Expression>>,
9228 #[serde(default)]
9229 pub schema: Option<Box<Expression>>,
9230 #[serde(default)]
9231 pub row_format_before: Option<Box<Expression>>,
9232 #[serde(default)]
9233 pub record_writer: Option<Box<Expression>>,
9234 #[serde(default)]
9235 pub row_format_after: Option<Box<Expression>>,
9236 #[serde(default)]
9237 pub record_reader: Option<Box<Expression>>,
9238}
9239
9240#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9242#[cfg_attr(feature = "bindings", derive(TS))]
9243pub struct SampleProperty {
9244 pub this: Box<Expression>,
9245}
9246
9247#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9249#[cfg_attr(feature = "bindings", derive(TS))]
9250pub struct SecurityProperty {
9251 pub this: Box<Expression>,
9252}
9253
9254#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9256#[cfg_attr(feature = "bindings", derive(TS))]
9257pub struct SchemaCommentProperty {
9258 pub this: Box<Expression>,
9259}
9260
9261#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9263#[cfg_attr(feature = "bindings", derive(TS))]
9264pub struct SemanticView {
9265 pub this: Box<Expression>,
9266 #[serde(default)]
9267 pub metrics: Option<Box<Expression>>,
9268 #[serde(default)]
9269 pub dimensions: Option<Box<Expression>>,
9270 #[serde(default)]
9271 pub facts: Option<Box<Expression>>,
9272 #[serde(default)]
9273 pub where_: Option<Box<Expression>>,
9274}
9275
9276#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9278#[cfg_attr(feature = "bindings", derive(TS))]
9279pub struct SerdeProperties {
9280 #[serde(default)]
9281 pub expressions: Vec<Expression>,
9282 #[serde(default)]
9283 pub with_: Option<Box<Expression>>,
9284}
9285
9286#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9288#[cfg_attr(feature = "bindings", derive(TS))]
9289pub struct SetProperty {
9290 #[serde(default)]
9291 pub multi: Option<Box<Expression>>,
9292}
9293
9294#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9296#[cfg_attr(feature = "bindings", derive(TS))]
9297pub struct SharingProperty {
9298 #[serde(default)]
9299 pub this: Option<Box<Expression>>,
9300}
9301
9302#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9304#[cfg_attr(feature = "bindings", derive(TS))]
9305pub struct SetConfigProperty {
9306 pub this: Box<Expression>,
9307}
9308
9309#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9311#[cfg_attr(feature = "bindings", derive(TS))]
9312pub struct SettingsProperty {
9313 #[serde(default)]
9314 pub expressions: Vec<Expression>,
9315}
9316
9317#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9319#[cfg_attr(feature = "bindings", derive(TS))]
9320pub struct SortKeyProperty {
9321 pub this: Box<Expression>,
9322 #[serde(default)]
9323 pub compound: Option<Box<Expression>>,
9324}
9325
9326#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9328#[cfg_attr(feature = "bindings", derive(TS))]
9329pub struct SqlReadWriteProperty {
9330 pub this: Box<Expression>,
9331}
9332
9333#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9335#[cfg_attr(feature = "bindings", derive(TS))]
9336pub struct SqlSecurityProperty {
9337 pub this: Box<Expression>,
9338}
9339
9340#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9342#[cfg_attr(feature = "bindings", derive(TS))]
9343pub struct StabilityProperty {
9344 pub this: Box<Expression>,
9345}
9346
9347#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9349#[cfg_attr(feature = "bindings", derive(TS))]
9350pub struct StorageHandlerProperty {
9351 pub this: Box<Expression>,
9352}
9353
9354#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9356#[cfg_attr(feature = "bindings", derive(TS))]
9357pub struct TemporaryProperty {
9358 #[serde(default)]
9359 pub this: Option<Box<Expression>>,
9360}
9361
9362#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9364#[cfg_attr(feature = "bindings", derive(TS))]
9365pub struct Tags {
9366 #[serde(default)]
9367 pub expressions: Vec<Expression>,
9368}
9369
9370#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9372#[cfg_attr(feature = "bindings", derive(TS))]
9373pub struct TransformModelProperty {
9374 #[serde(default)]
9375 pub expressions: Vec<Expression>,
9376}
9377
9378#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9380#[cfg_attr(feature = "bindings", derive(TS))]
9381pub struct TransientProperty {
9382 #[serde(default)]
9383 pub this: Option<Box<Expression>>,
9384}
9385
9386#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9388#[cfg_attr(feature = "bindings", derive(TS))]
9389pub struct UsingTemplateProperty {
9390 pub this: Box<Expression>,
9391}
9392
9393#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9395#[cfg_attr(feature = "bindings", derive(TS))]
9396pub struct ViewAttributeProperty {
9397 pub this: Box<Expression>,
9398}
9399
9400#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9402#[cfg_attr(feature = "bindings", derive(TS))]
9403pub struct VolatileProperty {
9404 #[serde(default)]
9405 pub this: Option<Box<Expression>>,
9406}
9407
9408#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9410#[cfg_attr(feature = "bindings", derive(TS))]
9411pub struct WithDataProperty {
9412 #[serde(default)]
9413 pub no: Option<Box<Expression>>,
9414 #[serde(default)]
9415 pub statistics: Option<Box<Expression>>,
9416}
9417
9418#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9420#[cfg_attr(feature = "bindings", derive(TS))]
9421pub struct WithJournalTableProperty {
9422 pub this: Box<Expression>,
9423}
9424
9425#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9427#[cfg_attr(feature = "bindings", derive(TS))]
9428pub struct WithSchemaBindingProperty {
9429 pub this: Box<Expression>,
9430}
9431
9432#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9434#[cfg_attr(feature = "bindings", derive(TS))]
9435pub struct WithSystemVersioningProperty {
9436 #[serde(default)]
9437 pub on: Option<Box<Expression>>,
9438 #[serde(default)]
9439 pub this: Option<Box<Expression>>,
9440 #[serde(default)]
9441 pub data_consistency: Option<Box<Expression>>,
9442 #[serde(default)]
9443 pub retention_period: Option<Box<Expression>>,
9444 #[serde(default)]
9445 pub with_: Option<Box<Expression>>,
9446}
9447
9448#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9450#[cfg_attr(feature = "bindings", derive(TS))]
9451pub struct WithProcedureOptions {
9452 #[serde(default)]
9453 pub expressions: Vec<Expression>,
9454}
9455
9456#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9458#[cfg_attr(feature = "bindings", derive(TS))]
9459pub struct EncodeProperty {
9460 pub this: Box<Expression>,
9461 #[serde(default)]
9462 pub properties: Vec<Expression>,
9463 #[serde(default)]
9464 pub key: Option<Box<Expression>>,
9465}
9466
9467#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9469#[cfg_attr(feature = "bindings", derive(TS))]
9470pub struct IncludeProperty {
9471 pub this: Box<Expression>,
9472 #[serde(default)]
9473 pub alias: Option<String>,
9474 #[serde(default)]
9475 pub column_def: Option<Box<Expression>>,
9476}
9477
9478#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9480#[cfg_attr(feature = "bindings", derive(TS))]
9481pub struct Properties {
9482 #[serde(default)]
9483 pub expressions: Vec<Expression>,
9484}
9485
9486#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9488#[cfg_attr(feature = "bindings", derive(TS))]
9489pub struct InputOutputFormat {
9490 #[serde(default)]
9491 pub input_format: Option<Box<Expression>>,
9492 #[serde(default)]
9493 pub output_format: Option<Box<Expression>>,
9494}
9495
9496#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9498#[cfg_attr(feature = "bindings", derive(TS))]
9499pub struct Reference {
9500 pub this: Box<Expression>,
9501 #[serde(default)]
9502 pub expressions: Vec<Expression>,
9503 #[serde(default)]
9504 pub options: Vec<Expression>,
9505}
9506
9507#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9509#[cfg_attr(feature = "bindings", derive(TS))]
9510pub struct QueryOption {
9511 pub this: Box<Expression>,
9512 #[serde(default)]
9513 pub expression: Option<Box<Expression>>,
9514}
9515
9516#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9518#[cfg_attr(feature = "bindings", derive(TS))]
9519pub struct WithTableHint {
9520 #[serde(default)]
9521 pub expressions: Vec<Expression>,
9522}
9523
9524#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9526#[cfg_attr(feature = "bindings", derive(TS))]
9527pub struct IndexTableHint {
9528 pub this: Box<Expression>,
9529 #[serde(default)]
9530 pub expressions: Vec<Expression>,
9531 #[serde(default)]
9532 pub target: Option<Box<Expression>>,
9533}
9534
9535#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9537#[cfg_attr(feature = "bindings", derive(TS))]
9538pub struct Get {
9539 pub this: Box<Expression>,
9540 #[serde(default)]
9541 pub target: Option<Box<Expression>>,
9542 #[serde(default)]
9543 pub properties: Vec<Expression>,
9544}
9545
9546#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9548#[cfg_attr(feature = "bindings", derive(TS))]
9549pub struct SetOperation {
9550 #[serde(default)]
9551 pub with_: Option<Box<Expression>>,
9552 pub this: Box<Expression>,
9553 pub expression: Box<Expression>,
9554 #[serde(default)]
9555 pub distinct: bool,
9556 #[serde(default)]
9557 pub by_name: Option<Box<Expression>>,
9558 #[serde(default)]
9559 pub side: Option<Box<Expression>>,
9560 #[serde(default)]
9561 pub kind: Option<String>,
9562 #[serde(default)]
9563 pub on: Option<Box<Expression>>,
9564}
9565
9566#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9568#[cfg_attr(feature = "bindings", derive(TS))]
9569pub struct Var {
9570 pub this: String,
9571}
9572
9573#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9575#[cfg_attr(feature = "bindings", derive(TS))]
9576pub struct Variadic {
9577 pub this: Box<Expression>,
9578}
9579
9580#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9582#[cfg_attr(feature = "bindings", derive(TS))]
9583pub struct Version {
9584 pub this: Box<Expression>,
9585 pub kind: String,
9586 #[serde(default)]
9587 pub expression: Option<Box<Expression>>,
9588}
9589
9590#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9592#[cfg_attr(feature = "bindings", derive(TS))]
9593pub struct Schema {
9594 #[serde(default)]
9595 pub this: Option<Box<Expression>>,
9596 #[serde(default)]
9597 pub expressions: Vec<Expression>,
9598}
9599
9600#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9602#[cfg_attr(feature = "bindings", derive(TS))]
9603pub struct Lock {
9604 #[serde(default)]
9605 pub update: Option<Box<Expression>>,
9606 #[serde(default)]
9607 pub expressions: Vec<Expression>,
9608 #[serde(default)]
9609 pub wait: Option<Box<Expression>>,
9610 #[serde(default)]
9611 pub key: Option<Box<Expression>>,
9612}
9613
9614#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9617#[cfg_attr(feature = "bindings", derive(TS))]
9618pub struct TableSample {
9619 #[serde(default, skip_serializing_if = "Option::is_none")]
9621 pub this: Option<Box<Expression>>,
9622 #[serde(default, skip_serializing_if = "Option::is_none")]
9624 pub sample: Option<Box<Sample>>,
9625 #[serde(default)]
9626 pub expressions: Vec<Expression>,
9627 #[serde(default)]
9628 pub method: Option<String>,
9629 #[serde(default)]
9630 pub bucket_numerator: Option<Box<Expression>>,
9631 #[serde(default)]
9632 pub bucket_denominator: Option<Box<Expression>>,
9633 #[serde(default)]
9634 pub bucket_field: Option<Box<Expression>>,
9635 #[serde(default)]
9636 pub percent: Option<Box<Expression>>,
9637 #[serde(default)]
9638 pub rows: Option<Box<Expression>>,
9639 #[serde(default)]
9640 pub size: Option<i64>,
9641 #[serde(default)]
9642 pub seed: Option<Box<Expression>>,
9643}
9644
9645#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9647#[cfg_attr(feature = "bindings", derive(TS))]
9648pub struct Tag {
9649 #[serde(default)]
9650 pub this: Option<Box<Expression>>,
9651 #[serde(default)]
9652 pub prefix: Option<Box<Expression>>,
9653 #[serde(default)]
9654 pub postfix: Option<Box<Expression>>,
9655}
9656
9657#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9659#[cfg_attr(feature = "bindings", derive(TS))]
9660pub struct UnpivotColumns {
9661 pub this: Box<Expression>,
9662 #[serde(default)]
9663 pub expressions: Vec<Expression>,
9664}
9665
9666#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9668#[cfg_attr(feature = "bindings", derive(TS))]
9669pub struct SessionParameter {
9670 pub this: Box<Expression>,
9671 #[serde(default)]
9672 pub kind: Option<String>,
9673}
9674
9675#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9677#[cfg_attr(feature = "bindings", derive(TS))]
9678pub struct PseudoType {
9679 pub this: Box<Expression>,
9680}
9681
9682#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9684#[cfg_attr(feature = "bindings", derive(TS))]
9685pub struct ObjectIdentifier {
9686 pub this: Box<Expression>,
9687}
9688
9689#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9691#[cfg_attr(feature = "bindings", derive(TS))]
9692pub struct Transaction {
9693 #[serde(default)]
9694 pub this: Option<Box<Expression>>,
9695 #[serde(default)]
9696 pub modes: Option<Box<Expression>>,
9697 #[serde(default)]
9698 pub mark: Option<Box<Expression>>,
9699}
9700
9701#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9703#[cfg_attr(feature = "bindings", derive(TS))]
9704pub struct Commit {
9705 #[serde(default)]
9706 pub chain: Option<Box<Expression>>,
9707 #[serde(default)]
9708 pub this: Option<Box<Expression>>,
9709 #[serde(default)]
9710 pub durability: Option<Box<Expression>>,
9711}
9712
9713#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9715#[cfg_attr(feature = "bindings", derive(TS))]
9716pub struct Rollback {
9717 #[serde(default)]
9718 pub savepoint: Option<Box<Expression>>,
9719 #[serde(default)]
9720 pub this: Option<Box<Expression>>,
9721}
9722
9723#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9725#[cfg_attr(feature = "bindings", derive(TS))]
9726pub struct AlterSession {
9727 #[serde(default)]
9728 pub expressions: Vec<Expression>,
9729 #[serde(default)]
9730 pub unset: Option<Box<Expression>>,
9731}
9732
9733#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9735#[cfg_attr(feature = "bindings", derive(TS))]
9736pub struct Analyze {
9737 #[serde(default)]
9738 pub kind: Option<String>,
9739 #[serde(default)]
9740 pub this: Option<Box<Expression>>,
9741 #[serde(default)]
9742 pub options: Vec<Expression>,
9743 #[serde(default)]
9744 pub mode: Option<Box<Expression>>,
9745 #[serde(default)]
9746 pub partition: Option<Box<Expression>>,
9747 #[serde(default)]
9748 pub expression: Option<Box<Expression>>,
9749 #[serde(default)]
9750 pub properties: Vec<Expression>,
9751 #[serde(default, skip_serializing_if = "Vec::is_empty")]
9753 pub columns: Vec<String>,
9754}
9755
9756#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9758#[cfg_attr(feature = "bindings", derive(TS))]
9759pub struct AnalyzeStatistics {
9760 pub kind: String,
9761 #[serde(default)]
9762 pub option: Option<Box<Expression>>,
9763 #[serde(default)]
9764 pub this: Option<Box<Expression>>,
9765 #[serde(default)]
9766 pub expressions: Vec<Expression>,
9767}
9768
9769#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9771#[cfg_attr(feature = "bindings", derive(TS))]
9772pub struct AnalyzeHistogram {
9773 pub this: Box<Expression>,
9774 #[serde(default)]
9775 pub expressions: Vec<Expression>,
9776 #[serde(default)]
9777 pub expression: Option<Box<Expression>>,
9778 #[serde(default)]
9779 pub update_options: Option<Box<Expression>>,
9780}
9781
9782#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9784#[cfg_attr(feature = "bindings", derive(TS))]
9785pub struct AnalyzeSample {
9786 pub kind: String,
9787 #[serde(default)]
9788 pub sample: Option<Box<Expression>>,
9789}
9790
9791#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9793#[cfg_attr(feature = "bindings", derive(TS))]
9794pub struct AnalyzeListChainedRows {
9795 #[serde(default)]
9796 pub expression: Option<Box<Expression>>,
9797}
9798
9799#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9801#[cfg_attr(feature = "bindings", derive(TS))]
9802pub struct AnalyzeDelete {
9803 #[serde(default)]
9804 pub kind: Option<String>,
9805}
9806
9807#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9809#[cfg_attr(feature = "bindings", derive(TS))]
9810pub struct AnalyzeWith {
9811 #[serde(default)]
9812 pub expressions: Vec<Expression>,
9813}
9814
9815#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9817#[cfg_attr(feature = "bindings", derive(TS))]
9818pub struct AnalyzeValidate {
9819 pub kind: String,
9820 #[serde(default)]
9821 pub this: Option<Box<Expression>>,
9822 #[serde(default)]
9823 pub expression: Option<Box<Expression>>,
9824}
9825
9826#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9828#[cfg_attr(feature = "bindings", derive(TS))]
9829pub struct AddPartition {
9830 pub this: Box<Expression>,
9831 #[serde(default)]
9832 pub exists: bool,
9833 #[serde(default)]
9834 pub location: Option<Box<Expression>>,
9835}
9836
9837#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9839#[cfg_attr(feature = "bindings", derive(TS))]
9840pub struct AttachOption {
9841 pub this: Box<Expression>,
9842 #[serde(default)]
9843 pub expression: Option<Box<Expression>>,
9844}
9845
9846#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9848#[cfg_attr(feature = "bindings", derive(TS))]
9849pub struct DropPartition {
9850 #[serde(default)]
9851 pub expressions: Vec<Expression>,
9852 #[serde(default)]
9853 pub exists: bool,
9854}
9855
9856#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9858#[cfg_attr(feature = "bindings", derive(TS))]
9859pub struct ReplacePartition {
9860 pub expression: Box<Expression>,
9861 #[serde(default)]
9862 pub source: Option<Box<Expression>>,
9863}
9864
9865#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9867#[cfg_attr(feature = "bindings", derive(TS))]
9868pub struct DPipe {
9869 pub this: Box<Expression>,
9870 pub expression: Box<Expression>,
9871 #[serde(default)]
9872 pub safe: Option<Box<Expression>>,
9873}
9874
9875#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9877#[cfg_attr(feature = "bindings", derive(TS))]
9878pub struct Operator {
9879 pub this: Box<Expression>,
9880 #[serde(default)]
9881 pub operator: Option<Box<Expression>>,
9882 pub expression: Box<Expression>,
9883 #[serde(default, skip_serializing_if = "Vec::is_empty")]
9885 pub comments: Vec<String>,
9886}
9887
9888#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9890#[cfg_attr(feature = "bindings", derive(TS))]
9891pub struct PivotAny {
9892 #[serde(default)]
9893 pub this: Option<Box<Expression>>,
9894}
9895
9896#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9898#[cfg_attr(feature = "bindings", derive(TS))]
9899pub struct Aliases {
9900 pub this: Box<Expression>,
9901 #[serde(default)]
9902 pub expressions: Vec<Expression>,
9903}
9904
9905#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9907#[cfg_attr(feature = "bindings", derive(TS))]
9908pub struct AtIndex {
9909 pub this: Box<Expression>,
9910 pub expression: Box<Expression>,
9911}
9912
9913#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9915#[cfg_attr(feature = "bindings", derive(TS))]
9916pub struct FromTimeZone {
9917 pub this: Box<Expression>,
9918 #[serde(default)]
9919 pub zone: Option<Box<Expression>>,
9920}
9921
9922#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9924#[cfg_attr(feature = "bindings", derive(TS))]
9925pub struct FormatPhrase {
9926 pub this: Box<Expression>,
9927 pub format: String,
9928}
9929
9930#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9932#[cfg_attr(feature = "bindings", derive(TS))]
9933pub struct ForIn {
9934 pub this: Box<Expression>,
9935 pub expression: Box<Expression>,
9936}
9937
9938#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9940#[cfg_attr(feature = "bindings", derive(TS))]
9941pub struct TimeUnit {
9942 #[serde(default)]
9943 pub unit: Option<String>,
9944}
9945
9946#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9948#[cfg_attr(feature = "bindings", derive(TS))]
9949pub struct IntervalOp {
9950 #[serde(default)]
9951 pub unit: Option<String>,
9952 pub expression: Box<Expression>,
9953}
9954
9955#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9957#[cfg_attr(feature = "bindings", derive(TS))]
9958pub struct HavingMax {
9959 pub this: Box<Expression>,
9960 pub expression: Box<Expression>,
9961 #[serde(default)]
9962 pub max: Option<Box<Expression>>,
9963}
9964
9965#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9967#[cfg_attr(feature = "bindings", derive(TS))]
9968pub struct CosineDistance {
9969 pub this: Box<Expression>,
9970 pub expression: Box<Expression>,
9971}
9972
9973#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9975#[cfg_attr(feature = "bindings", derive(TS))]
9976pub struct DotProduct {
9977 pub this: Box<Expression>,
9978 pub expression: Box<Expression>,
9979}
9980
9981#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9983#[cfg_attr(feature = "bindings", derive(TS))]
9984pub struct EuclideanDistance {
9985 pub this: Box<Expression>,
9986 pub expression: Box<Expression>,
9987}
9988
9989#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9991#[cfg_attr(feature = "bindings", derive(TS))]
9992pub struct ManhattanDistance {
9993 pub this: Box<Expression>,
9994 pub expression: Box<Expression>,
9995}
9996
9997#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9999#[cfg_attr(feature = "bindings", derive(TS))]
10000pub struct JarowinklerSimilarity {
10001 pub this: Box<Expression>,
10002 pub expression: Box<Expression>,
10003}
10004
10005#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10007#[cfg_attr(feature = "bindings", derive(TS))]
10008pub struct Booland {
10009 pub this: Box<Expression>,
10010 pub expression: Box<Expression>,
10011}
10012
10013#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10015#[cfg_attr(feature = "bindings", derive(TS))]
10016pub struct Boolor {
10017 pub this: Box<Expression>,
10018 pub expression: Box<Expression>,
10019}
10020
10021#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10023#[cfg_attr(feature = "bindings", derive(TS))]
10024pub struct ParameterizedAgg {
10025 pub this: Box<Expression>,
10026 #[serde(default)]
10027 pub expressions: Vec<Expression>,
10028 #[serde(default)]
10029 pub params: Vec<Expression>,
10030}
10031
10032#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10034#[cfg_attr(feature = "bindings", derive(TS))]
10035pub struct ArgMax {
10036 pub this: Box<Expression>,
10037 pub expression: Box<Expression>,
10038 #[serde(default)]
10039 pub count: Option<Box<Expression>>,
10040}
10041
10042#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10044#[cfg_attr(feature = "bindings", derive(TS))]
10045pub struct ArgMin {
10046 pub this: Box<Expression>,
10047 pub expression: Box<Expression>,
10048 #[serde(default)]
10049 pub count: Option<Box<Expression>>,
10050}
10051
10052#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10054#[cfg_attr(feature = "bindings", derive(TS))]
10055pub struct ApproxTopK {
10056 pub this: Box<Expression>,
10057 #[serde(default)]
10058 pub expression: Option<Box<Expression>>,
10059 #[serde(default)]
10060 pub counters: Option<Box<Expression>>,
10061}
10062
10063#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10065#[cfg_attr(feature = "bindings", derive(TS))]
10066pub struct ApproxTopKAccumulate {
10067 pub this: Box<Expression>,
10068 #[serde(default)]
10069 pub expression: Option<Box<Expression>>,
10070}
10071
10072#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10074#[cfg_attr(feature = "bindings", derive(TS))]
10075pub struct ApproxTopKCombine {
10076 pub this: Box<Expression>,
10077 #[serde(default)]
10078 pub expression: Option<Box<Expression>>,
10079}
10080
10081#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10083#[cfg_attr(feature = "bindings", derive(TS))]
10084pub struct ApproxTopKEstimate {
10085 pub this: Box<Expression>,
10086 #[serde(default)]
10087 pub expression: Option<Box<Expression>>,
10088}
10089
10090#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10092#[cfg_attr(feature = "bindings", derive(TS))]
10093pub struct ApproxTopSum {
10094 pub this: Box<Expression>,
10095 pub expression: Box<Expression>,
10096 #[serde(default)]
10097 pub count: Option<Box<Expression>>,
10098}
10099
10100#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10102#[cfg_attr(feature = "bindings", derive(TS))]
10103pub struct ApproxQuantiles {
10104 pub this: Box<Expression>,
10105 #[serde(default)]
10106 pub expression: Option<Box<Expression>>,
10107}
10108
10109#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10111#[cfg_attr(feature = "bindings", derive(TS))]
10112pub struct Minhash {
10113 pub this: Box<Expression>,
10114 #[serde(default)]
10115 pub expressions: Vec<Expression>,
10116}
10117
10118#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10120#[cfg_attr(feature = "bindings", derive(TS))]
10121pub struct FarmFingerprint {
10122 #[serde(default)]
10123 pub expressions: Vec<Expression>,
10124}
10125
10126#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10128#[cfg_attr(feature = "bindings", derive(TS))]
10129pub struct Float64 {
10130 pub this: Box<Expression>,
10131 #[serde(default)]
10132 pub expression: Option<Box<Expression>>,
10133}
10134
10135#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10137#[cfg_attr(feature = "bindings", derive(TS))]
10138pub struct Transform {
10139 pub this: Box<Expression>,
10140 pub expression: Box<Expression>,
10141}
10142
10143#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10145#[cfg_attr(feature = "bindings", derive(TS))]
10146pub struct Translate {
10147 pub this: Box<Expression>,
10148 #[serde(default)]
10149 pub from_: Option<Box<Expression>>,
10150 #[serde(default)]
10151 pub to: Option<Box<Expression>>,
10152}
10153
10154#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10156#[cfg_attr(feature = "bindings", derive(TS))]
10157pub struct Grouping {
10158 #[serde(default)]
10159 pub expressions: Vec<Expression>,
10160}
10161
10162#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10164#[cfg_attr(feature = "bindings", derive(TS))]
10165pub struct GroupingId {
10166 #[serde(default)]
10167 pub expressions: Vec<Expression>,
10168}
10169
10170#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10172#[cfg_attr(feature = "bindings", derive(TS))]
10173pub struct Anonymous {
10174 pub this: Box<Expression>,
10175 #[serde(default)]
10176 pub expressions: Vec<Expression>,
10177}
10178
10179#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10181#[cfg_attr(feature = "bindings", derive(TS))]
10182pub struct AnonymousAggFunc {
10183 pub this: Box<Expression>,
10184 #[serde(default)]
10185 pub expressions: Vec<Expression>,
10186}
10187
10188#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10190#[cfg_attr(feature = "bindings", derive(TS))]
10191pub struct CombinedAggFunc {
10192 pub this: Box<Expression>,
10193 #[serde(default)]
10194 pub expressions: Vec<Expression>,
10195}
10196
10197#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10199#[cfg_attr(feature = "bindings", derive(TS))]
10200pub struct CombinedParameterizedAgg {
10201 pub this: Box<Expression>,
10202 #[serde(default)]
10203 pub expressions: Vec<Expression>,
10204 #[serde(default)]
10205 pub params: Vec<Expression>,
10206}
10207
10208#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10210#[cfg_attr(feature = "bindings", derive(TS))]
10211pub struct HashAgg {
10212 pub this: Box<Expression>,
10213 #[serde(default)]
10214 pub expressions: Vec<Expression>,
10215}
10216
10217#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10219#[cfg_attr(feature = "bindings", derive(TS))]
10220pub struct Hll {
10221 pub this: Box<Expression>,
10222 #[serde(default)]
10223 pub expressions: Vec<Expression>,
10224}
10225
10226#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10228#[cfg_attr(feature = "bindings", derive(TS))]
10229pub struct Apply {
10230 pub this: Box<Expression>,
10231 pub expression: Box<Expression>,
10232}
10233
10234#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10236#[cfg_attr(feature = "bindings", derive(TS))]
10237pub struct ToBoolean {
10238 pub this: Box<Expression>,
10239 #[serde(default)]
10240 pub safe: Option<Box<Expression>>,
10241}
10242
10243#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10245#[cfg_attr(feature = "bindings", derive(TS))]
10246pub struct List {
10247 #[serde(default)]
10248 pub expressions: Vec<Expression>,
10249}
10250
10251#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10256#[cfg_attr(feature = "bindings", derive(TS))]
10257pub struct ToMap {
10258 pub this: Box<Expression>,
10260}
10261
10262#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10264#[cfg_attr(feature = "bindings", derive(TS))]
10265pub struct Pad {
10266 pub this: Box<Expression>,
10267 pub expression: Box<Expression>,
10268 #[serde(default)]
10269 pub fill_pattern: Option<Box<Expression>>,
10270 #[serde(default)]
10271 pub is_left: Option<Box<Expression>>,
10272}
10273
10274#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10276#[cfg_attr(feature = "bindings", derive(TS))]
10277pub struct ToChar {
10278 pub this: Box<Expression>,
10279 #[serde(default)]
10280 pub format: Option<String>,
10281 #[serde(default)]
10282 pub nlsparam: Option<Box<Expression>>,
10283 #[serde(default)]
10284 pub is_numeric: Option<Box<Expression>>,
10285}
10286
10287#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10289#[cfg_attr(feature = "bindings", derive(TS))]
10290pub struct StringFunc {
10291 pub this: Box<Expression>,
10292 #[serde(default)]
10293 pub zone: Option<Box<Expression>>,
10294}
10295
10296#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10298#[cfg_attr(feature = "bindings", derive(TS))]
10299pub struct ToNumber {
10300 pub this: Box<Expression>,
10301 #[serde(default)]
10302 pub format: Option<Box<Expression>>,
10303 #[serde(default)]
10304 pub nlsparam: Option<Box<Expression>>,
10305 #[serde(default)]
10306 pub precision: Option<Box<Expression>>,
10307 #[serde(default)]
10308 pub scale: Option<Box<Expression>>,
10309 #[serde(default)]
10310 pub safe: Option<Box<Expression>>,
10311 #[serde(default)]
10312 pub safe_name: Option<Box<Expression>>,
10313}
10314
10315#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10317#[cfg_attr(feature = "bindings", derive(TS))]
10318pub struct ToDouble {
10319 pub this: Box<Expression>,
10320 #[serde(default)]
10321 pub format: Option<String>,
10322 #[serde(default)]
10323 pub safe: Option<Box<Expression>>,
10324}
10325
10326#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10328#[cfg_attr(feature = "bindings", derive(TS))]
10329pub struct ToDecfloat {
10330 pub this: Box<Expression>,
10331 #[serde(default)]
10332 pub format: Option<String>,
10333}
10334
10335#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10337#[cfg_attr(feature = "bindings", derive(TS))]
10338pub struct TryToDecfloat {
10339 pub this: Box<Expression>,
10340 #[serde(default)]
10341 pub format: Option<String>,
10342}
10343
10344#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10346#[cfg_attr(feature = "bindings", derive(TS))]
10347pub struct ToFile {
10348 pub this: Box<Expression>,
10349 #[serde(default)]
10350 pub path: Option<Box<Expression>>,
10351 #[serde(default)]
10352 pub safe: Option<Box<Expression>>,
10353}
10354
10355#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10357#[cfg_attr(feature = "bindings", derive(TS))]
10358pub struct Columns {
10359 pub this: Box<Expression>,
10360 #[serde(default)]
10361 pub unpack: Option<Box<Expression>>,
10362}
10363
10364#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10366#[cfg_attr(feature = "bindings", derive(TS))]
10367pub struct ConvertToCharset {
10368 pub this: Box<Expression>,
10369 #[serde(default)]
10370 pub dest: Option<Box<Expression>>,
10371 #[serde(default)]
10372 pub source: Option<Box<Expression>>,
10373}
10374
10375#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10377#[cfg_attr(feature = "bindings", derive(TS))]
10378pub struct ConvertTimezone {
10379 #[serde(default)]
10380 pub source_tz: Option<Box<Expression>>,
10381 #[serde(default)]
10382 pub target_tz: Option<Box<Expression>>,
10383 #[serde(default)]
10384 pub timestamp: Option<Box<Expression>>,
10385 #[serde(default)]
10386 pub options: Vec<Expression>,
10387}
10388
10389#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10391#[cfg_attr(feature = "bindings", derive(TS))]
10392pub struct GenerateSeries {
10393 #[serde(default)]
10394 pub start: Option<Box<Expression>>,
10395 #[serde(default)]
10396 pub end: Option<Box<Expression>>,
10397 #[serde(default)]
10398 pub step: Option<Box<Expression>>,
10399 #[serde(default)]
10400 pub is_end_exclusive: Option<Box<Expression>>,
10401}
10402
10403#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10405#[cfg_attr(feature = "bindings", derive(TS))]
10406pub struct AIAgg {
10407 pub this: Box<Expression>,
10408 pub expression: Box<Expression>,
10409}
10410
10411#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10413#[cfg_attr(feature = "bindings", derive(TS))]
10414pub struct AIClassify {
10415 pub this: Box<Expression>,
10416 #[serde(default)]
10417 pub categories: Option<Box<Expression>>,
10418 #[serde(default)]
10419 pub config: Option<Box<Expression>>,
10420}
10421
10422#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10424#[cfg_attr(feature = "bindings", derive(TS))]
10425pub struct ArrayAll {
10426 pub this: Box<Expression>,
10427 pub expression: Box<Expression>,
10428}
10429
10430#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10432#[cfg_attr(feature = "bindings", derive(TS))]
10433pub struct ArrayAny {
10434 pub this: Box<Expression>,
10435 pub expression: Box<Expression>,
10436}
10437
10438#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10440#[cfg_attr(feature = "bindings", derive(TS))]
10441pub struct ArrayConstructCompact {
10442 #[serde(default)]
10443 pub expressions: Vec<Expression>,
10444}
10445
10446#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10448#[cfg_attr(feature = "bindings", derive(TS))]
10449pub struct StPoint {
10450 pub this: Box<Expression>,
10451 pub expression: Box<Expression>,
10452 #[serde(default)]
10453 pub null: Option<Box<Expression>>,
10454}
10455
10456#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10458#[cfg_attr(feature = "bindings", derive(TS))]
10459pub struct StDistance {
10460 pub this: Box<Expression>,
10461 pub expression: Box<Expression>,
10462 #[serde(default)]
10463 pub use_spheroid: Option<Box<Expression>>,
10464}
10465
10466#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10468#[cfg_attr(feature = "bindings", derive(TS))]
10469pub struct StringToArray {
10470 pub this: Box<Expression>,
10471 #[serde(default)]
10472 pub expression: Option<Box<Expression>>,
10473 #[serde(default)]
10474 pub null: Option<Box<Expression>>,
10475}
10476
10477#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10479#[cfg_attr(feature = "bindings", derive(TS))]
10480pub struct ArraySum {
10481 pub this: Box<Expression>,
10482 #[serde(default)]
10483 pub expression: Option<Box<Expression>>,
10484}
10485
10486#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10488#[cfg_attr(feature = "bindings", derive(TS))]
10489pub struct ObjectAgg {
10490 pub this: Box<Expression>,
10491 pub expression: Box<Expression>,
10492}
10493
10494#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10496#[cfg_attr(feature = "bindings", derive(TS))]
10497pub struct CastToStrType {
10498 pub this: Box<Expression>,
10499 #[serde(default)]
10500 pub to: Option<Box<Expression>>,
10501}
10502
10503#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10505#[cfg_attr(feature = "bindings", derive(TS))]
10506pub struct CheckJson {
10507 pub this: Box<Expression>,
10508}
10509
10510#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10512#[cfg_attr(feature = "bindings", derive(TS))]
10513pub struct CheckXml {
10514 pub this: Box<Expression>,
10515 #[serde(default)]
10516 pub disable_auto_convert: Option<Box<Expression>>,
10517}
10518
10519#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10521#[cfg_attr(feature = "bindings", derive(TS))]
10522pub struct TranslateCharacters {
10523 pub this: Box<Expression>,
10524 pub expression: Box<Expression>,
10525 #[serde(default)]
10526 pub with_error: Option<Box<Expression>>,
10527}
10528
10529#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10531#[cfg_attr(feature = "bindings", derive(TS))]
10532pub struct CurrentSchemas {
10533 #[serde(default)]
10534 pub this: Option<Box<Expression>>,
10535}
10536
10537#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10539#[cfg_attr(feature = "bindings", derive(TS))]
10540pub struct CurrentDatetime {
10541 #[serde(default)]
10542 pub this: Option<Box<Expression>>,
10543}
10544
10545#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10547#[cfg_attr(feature = "bindings", derive(TS))]
10548pub struct Localtime {
10549 #[serde(default)]
10550 pub this: Option<Box<Expression>>,
10551}
10552
10553#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10555#[cfg_attr(feature = "bindings", derive(TS))]
10556pub struct Localtimestamp {
10557 #[serde(default)]
10558 pub this: Option<Box<Expression>>,
10559}
10560
10561#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10563#[cfg_attr(feature = "bindings", derive(TS))]
10564pub struct Systimestamp {
10565 #[serde(default)]
10566 pub this: Option<Box<Expression>>,
10567}
10568
10569#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10571#[cfg_attr(feature = "bindings", derive(TS))]
10572pub struct CurrentSchema {
10573 #[serde(default)]
10574 pub this: Option<Box<Expression>>,
10575}
10576
10577#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10579#[cfg_attr(feature = "bindings", derive(TS))]
10580pub struct CurrentUser {
10581 #[serde(default)]
10582 pub this: Option<Box<Expression>>,
10583}
10584
10585#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10587#[cfg_attr(feature = "bindings", derive(TS))]
10588pub struct SessionUser;
10589
10590#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10592#[cfg_attr(feature = "bindings", derive(TS))]
10593pub struct JSONPathRoot;
10594
10595#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10597#[cfg_attr(feature = "bindings", derive(TS))]
10598pub struct UtcTime {
10599 #[serde(default)]
10600 pub this: Option<Box<Expression>>,
10601}
10602
10603#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10605#[cfg_attr(feature = "bindings", derive(TS))]
10606pub struct UtcTimestamp {
10607 #[serde(default)]
10608 pub this: Option<Box<Expression>>,
10609}
10610
10611#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10613#[cfg_attr(feature = "bindings", derive(TS))]
10614pub struct TimestampFunc {
10615 #[serde(default)]
10616 pub this: Option<Box<Expression>>,
10617 #[serde(default)]
10618 pub zone: Option<Box<Expression>>,
10619 #[serde(default)]
10620 pub with_tz: Option<bool>,
10621 #[serde(default)]
10622 pub safe: Option<bool>,
10623}
10624
10625#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10627#[cfg_attr(feature = "bindings", derive(TS))]
10628pub struct DateBin {
10629 pub this: Box<Expression>,
10630 pub expression: Box<Expression>,
10631 #[serde(default)]
10632 pub unit: Option<String>,
10633 #[serde(default)]
10634 pub zone: Option<Box<Expression>>,
10635 #[serde(default)]
10636 pub origin: Option<Box<Expression>>,
10637}
10638
10639#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10641#[cfg_attr(feature = "bindings", derive(TS))]
10642pub struct Datetime {
10643 pub this: Box<Expression>,
10644 #[serde(default)]
10645 pub expression: Option<Box<Expression>>,
10646}
10647
10648#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10650#[cfg_attr(feature = "bindings", derive(TS))]
10651pub struct DatetimeAdd {
10652 pub this: Box<Expression>,
10653 pub expression: Box<Expression>,
10654 #[serde(default)]
10655 pub unit: Option<String>,
10656}
10657
10658#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10660#[cfg_attr(feature = "bindings", derive(TS))]
10661pub struct DatetimeSub {
10662 pub this: Box<Expression>,
10663 pub expression: Box<Expression>,
10664 #[serde(default)]
10665 pub unit: Option<String>,
10666}
10667
10668#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10670#[cfg_attr(feature = "bindings", derive(TS))]
10671pub struct DatetimeDiff {
10672 pub this: Box<Expression>,
10673 pub expression: Box<Expression>,
10674 #[serde(default)]
10675 pub unit: Option<String>,
10676}
10677
10678#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10680#[cfg_attr(feature = "bindings", derive(TS))]
10681pub struct DatetimeTrunc {
10682 pub this: Box<Expression>,
10683 pub unit: String,
10684 #[serde(default)]
10685 pub zone: Option<Box<Expression>>,
10686}
10687
10688#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10690#[cfg_attr(feature = "bindings", derive(TS))]
10691pub struct Dayname {
10692 pub this: Box<Expression>,
10693 #[serde(default)]
10694 pub abbreviated: Option<Box<Expression>>,
10695}
10696
10697#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10699#[cfg_attr(feature = "bindings", derive(TS))]
10700pub struct MakeInterval {
10701 #[serde(default)]
10702 pub year: Option<Box<Expression>>,
10703 #[serde(default)]
10704 pub month: Option<Box<Expression>>,
10705 #[serde(default)]
10706 pub week: Option<Box<Expression>>,
10707 #[serde(default)]
10708 pub day: Option<Box<Expression>>,
10709 #[serde(default)]
10710 pub hour: Option<Box<Expression>>,
10711 #[serde(default)]
10712 pub minute: Option<Box<Expression>>,
10713 #[serde(default)]
10714 pub second: Option<Box<Expression>>,
10715}
10716
10717#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10719#[cfg_attr(feature = "bindings", derive(TS))]
10720pub struct PreviousDay {
10721 pub this: Box<Expression>,
10722 pub expression: Box<Expression>,
10723}
10724
10725#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10727#[cfg_attr(feature = "bindings", derive(TS))]
10728pub struct Elt {
10729 pub this: Box<Expression>,
10730 #[serde(default)]
10731 pub expressions: Vec<Expression>,
10732}
10733
10734#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10736#[cfg_attr(feature = "bindings", derive(TS))]
10737pub struct TimestampAdd {
10738 pub this: Box<Expression>,
10739 pub expression: Box<Expression>,
10740 #[serde(default)]
10741 pub unit: Option<String>,
10742}
10743
10744#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10746#[cfg_attr(feature = "bindings", derive(TS))]
10747pub struct TimestampSub {
10748 pub this: Box<Expression>,
10749 pub expression: Box<Expression>,
10750 #[serde(default)]
10751 pub unit: Option<String>,
10752}
10753
10754#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10756#[cfg_attr(feature = "bindings", derive(TS))]
10757pub struct TimestampDiff {
10758 pub this: Box<Expression>,
10759 pub expression: Box<Expression>,
10760 #[serde(default)]
10761 pub unit: Option<String>,
10762}
10763
10764#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10766#[cfg_attr(feature = "bindings", derive(TS))]
10767pub struct TimeSlice {
10768 pub this: Box<Expression>,
10769 pub expression: Box<Expression>,
10770 pub unit: String,
10771 #[serde(default)]
10772 pub kind: Option<String>,
10773}
10774
10775#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10777#[cfg_attr(feature = "bindings", derive(TS))]
10778pub struct TimeAdd {
10779 pub this: Box<Expression>,
10780 pub expression: Box<Expression>,
10781 #[serde(default)]
10782 pub unit: Option<String>,
10783}
10784
10785#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10787#[cfg_attr(feature = "bindings", derive(TS))]
10788pub struct TimeSub {
10789 pub this: Box<Expression>,
10790 pub expression: Box<Expression>,
10791 #[serde(default)]
10792 pub unit: Option<String>,
10793}
10794
10795#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10797#[cfg_attr(feature = "bindings", derive(TS))]
10798pub struct TimeDiff {
10799 pub this: Box<Expression>,
10800 pub expression: Box<Expression>,
10801 #[serde(default)]
10802 pub unit: Option<String>,
10803}
10804
10805#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10807#[cfg_attr(feature = "bindings", derive(TS))]
10808pub struct TimeTrunc {
10809 pub this: Box<Expression>,
10810 pub unit: String,
10811 #[serde(default)]
10812 pub zone: Option<Box<Expression>>,
10813}
10814
10815#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10817#[cfg_attr(feature = "bindings", derive(TS))]
10818pub struct DateFromParts {
10819 #[serde(default)]
10820 pub year: Option<Box<Expression>>,
10821 #[serde(default)]
10822 pub month: Option<Box<Expression>>,
10823 #[serde(default)]
10824 pub day: Option<Box<Expression>>,
10825 #[serde(default)]
10826 pub allow_overflow: Option<Box<Expression>>,
10827}
10828
10829#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10831#[cfg_attr(feature = "bindings", derive(TS))]
10832pub struct TimeFromParts {
10833 #[serde(default)]
10834 pub hour: Option<Box<Expression>>,
10835 #[serde(default)]
10836 pub min: Option<Box<Expression>>,
10837 #[serde(default)]
10838 pub sec: Option<Box<Expression>>,
10839 #[serde(default)]
10840 pub nano: Option<Box<Expression>>,
10841 #[serde(default)]
10842 pub fractions: Option<Box<Expression>>,
10843 #[serde(default)]
10844 pub precision: Option<i64>,
10845}
10846
10847#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10849#[cfg_attr(feature = "bindings", derive(TS))]
10850pub struct DecodeCase {
10851 #[serde(default)]
10852 pub expressions: Vec<Expression>,
10853}
10854
10855#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10857#[cfg_attr(feature = "bindings", derive(TS))]
10858pub struct Decrypt {
10859 pub this: Box<Expression>,
10860 #[serde(default)]
10861 pub passphrase: Option<Box<Expression>>,
10862 #[serde(default)]
10863 pub aad: Option<Box<Expression>>,
10864 #[serde(default)]
10865 pub encryption_method: Option<Box<Expression>>,
10866 #[serde(default)]
10867 pub safe: Option<Box<Expression>>,
10868}
10869
10870#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10872#[cfg_attr(feature = "bindings", derive(TS))]
10873pub struct DecryptRaw {
10874 pub this: Box<Expression>,
10875 #[serde(default)]
10876 pub key: Option<Box<Expression>>,
10877 #[serde(default)]
10878 pub iv: Option<Box<Expression>>,
10879 #[serde(default)]
10880 pub aad: Option<Box<Expression>>,
10881 #[serde(default)]
10882 pub encryption_method: Option<Box<Expression>>,
10883 #[serde(default)]
10884 pub aead: Option<Box<Expression>>,
10885 #[serde(default)]
10886 pub safe: Option<Box<Expression>>,
10887}
10888
10889#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10891#[cfg_attr(feature = "bindings", derive(TS))]
10892pub struct Encode {
10893 pub this: Box<Expression>,
10894 #[serde(default)]
10895 pub charset: Option<Box<Expression>>,
10896}
10897
10898#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10900#[cfg_attr(feature = "bindings", derive(TS))]
10901pub struct Encrypt {
10902 pub this: Box<Expression>,
10903 #[serde(default)]
10904 pub passphrase: Option<Box<Expression>>,
10905 #[serde(default)]
10906 pub aad: Option<Box<Expression>>,
10907 #[serde(default)]
10908 pub encryption_method: Option<Box<Expression>>,
10909}
10910
10911#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10913#[cfg_attr(feature = "bindings", derive(TS))]
10914pub struct EncryptRaw {
10915 pub this: Box<Expression>,
10916 #[serde(default)]
10917 pub key: Option<Box<Expression>>,
10918 #[serde(default)]
10919 pub iv: Option<Box<Expression>>,
10920 #[serde(default)]
10921 pub aad: Option<Box<Expression>>,
10922 #[serde(default)]
10923 pub encryption_method: Option<Box<Expression>>,
10924}
10925
10926#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10928#[cfg_attr(feature = "bindings", derive(TS))]
10929pub struct EqualNull {
10930 pub this: Box<Expression>,
10931 pub expression: Box<Expression>,
10932}
10933
10934#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10936#[cfg_attr(feature = "bindings", derive(TS))]
10937pub struct ToBinary {
10938 pub this: Box<Expression>,
10939 #[serde(default)]
10940 pub format: Option<String>,
10941 #[serde(default)]
10942 pub safe: Option<Box<Expression>>,
10943}
10944
10945#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10947#[cfg_attr(feature = "bindings", derive(TS))]
10948pub struct Base64DecodeBinary {
10949 pub this: Box<Expression>,
10950 #[serde(default)]
10951 pub alphabet: Option<Box<Expression>>,
10952}
10953
10954#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10956#[cfg_attr(feature = "bindings", derive(TS))]
10957pub struct Base64DecodeString {
10958 pub this: Box<Expression>,
10959 #[serde(default)]
10960 pub alphabet: Option<Box<Expression>>,
10961}
10962
10963#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10965#[cfg_attr(feature = "bindings", derive(TS))]
10966pub struct Base64Encode {
10967 pub this: Box<Expression>,
10968 #[serde(default)]
10969 pub max_line_length: Option<Box<Expression>>,
10970 #[serde(default)]
10971 pub alphabet: Option<Box<Expression>>,
10972}
10973
10974#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10976#[cfg_attr(feature = "bindings", derive(TS))]
10977pub struct TryBase64DecodeBinary {
10978 pub this: Box<Expression>,
10979 #[serde(default)]
10980 pub alphabet: Option<Box<Expression>>,
10981}
10982
10983#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10985#[cfg_attr(feature = "bindings", derive(TS))]
10986pub struct TryBase64DecodeString {
10987 pub this: Box<Expression>,
10988 #[serde(default)]
10989 pub alphabet: Option<Box<Expression>>,
10990}
10991
10992#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10994#[cfg_attr(feature = "bindings", derive(TS))]
10995pub struct GapFill {
10996 pub this: Box<Expression>,
10997 #[serde(default)]
10998 pub ts_column: Option<Box<Expression>>,
10999 #[serde(default)]
11000 pub bucket_width: Option<Box<Expression>>,
11001 #[serde(default)]
11002 pub partitioning_columns: Option<Box<Expression>>,
11003 #[serde(default)]
11004 pub value_columns: Option<Box<Expression>>,
11005 #[serde(default)]
11006 pub origin: Option<Box<Expression>>,
11007 #[serde(default)]
11008 pub ignore_nulls: Option<Box<Expression>>,
11009}
11010
11011#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11013#[cfg_attr(feature = "bindings", derive(TS))]
11014pub struct GenerateDateArray {
11015 #[serde(default)]
11016 pub start: Option<Box<Expression>>,
11017 #[serde(default)]
11018 pub end: Option<Box<Expression>>,
11019 #[serde(default)]
11020 pub step: Option<Box<Expression>>,
11021}
11022
11023#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11025#[cfg_attr(feature = "bindings", derive(TS))]
11026pub struct GenerateTimestampArray {
11027 #[serde(default)]
11028 pub start: Option<Box<Expression>>,
11029 #[serde(default)]
11030 pub end: Option<Box<Expression>>,
11031 #[serde(default)]
11032 pub step: Option<Box<Expression>>,
11033}
11034
11035#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11037#[cfg_attr(feature = "bindings", derive(TS))]
11038pub struct GetExtract {
11039 pub this: Box<Expression>,
11040 pub expression: Box<Expression>,
11041}
11042
11043#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11045#[cfg_attr(feature = "bindings", derive(TS))]
11046pub struct Getbit {
11047 pub this: Box<Expression>,
11048 pub expression: Box<Expression>,
11049 #[serde(default)]
11050 pub zero_is_msb: Option<Box<Expression>>,
11051}
11052
11053#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11055#[cfg_attr(feature = "bindings", derive(TS))]
11056pub struct OverflowTruncateBehavior {
11057 #[serde(default)]
11058 pub this: Option<Box<Expression>>,
11059 #[serde(default)]
11060 pub with_count: Option<Box<Expression>>,
11061}
11062
11063#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11065#[cfg_attr(feature = "bindings", derive(TS))]
11066pub struct HexEncode {
11067 pub this: Box<Expression>,
11068 #[serde(default)]
11069 pub case: Option<Box<Expression>>,
11070}
11071
11072#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11074#[cfg_attr(feature = "bindings", derive(TS))]
11075pub struct Compress {
11076 pub this: Box<Expression>,
11077 #[serde(default)]
11078 pub method: Option<String>,
11079}
11080
11081#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11083#[cfg_attr(feature = "bindings", derive(TS))]
11084pub struct DecompressBinary {
11085 pub this: Box<Expression>,
11086 pub method: String,
11087}
11088
11089#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11091#[cfg_attr(feature = "bindings", derive(TS))]
11092pub struct DecompressString {
11093 pub this: Box<Expression>,
11094 pub method: String,
11095}
11096
11097#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11099#[cfg_attr(feature = "bindings", derive(TS))]
11100pub struct Xor {
11101 #[serde(default)]
11102 pub this: Option<Box<Expression>>,
11103 #[serde(default)]
11104 pub expression: Option<Box<Expression>>,
11105 #[serde(default)]
11106 pub expressions: Vec<Expression>,
11107}
11108
11109#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11111#[cfg_attr(feature = "bindings", derive(TS))]
11112pub struct Nullif {
11113 pub this: Box<Expression>,
11114 pub expression: Box<Expression>,
11115}
11116
11117#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11119#[cfg_attr(feature = "bindings", derive(TS))]
11120pub struct JSON {
11121 #[serde(default)]
11122 pub this: Option<Box<Expression>>,
11123 #[serde(default)]
11124 pub with_: Option<Box<Expression>>,
11125 #[serde(default)]
11126 pub unique: bool,
11127}
11128
11129#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11131#[cfg_attr(feature = "bindings", derive(TS))]
11132pub struct JSONPath {
11133 #[serde(default)]
11134 pub expressions: Vec<Expression>,
11135 #[serde(default)]
11136 pub escape: Option<Box<Expression>>,
11137}
11138
11139#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11141#[cfg_attr(feature = "bindings", derive(TS))]
11142pub struct JSONPathFilter {
11143 pub this: Box<Expression>,
11144}
11145
11146#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11148#[cfg_attr(feature = "bindings", derive(TS))]
11149pub struct JSONPathKey {
11150 pub this: Box<Expression>,
11151}
11152
11153#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11155#[cfg_attr(feature = "bindings", derive(TS))]
11156pub struct JSONPathRecursive {
11157 #[serde(default)]
11158 pub this: Option<Box<Expression>>,
11159}
11160
11161#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11163#[cfg_attr(feature = "bindings", derive(TS))]
11164pub struct JSONPathScript {
11165 pub this: Box<Expression>,
11166}
11167
11168#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11170#[cfg_attr(feature = "bindings", derive(TS))]
11171pub struct JSONPathSlice {
11172 #[serde(default)]
11173 pub start: Option<Box<Expression>>,
11174 #[serde(default)]
11175 pub end: Option<Box<Expression>>,
11176 #[serde(default)]
11177 pub step: Option<Box<Expression>>,
11178}
11179
11180#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11182#[cfg_attr(feature = "bindings", derive(TS))]
11183pub struct JSONPathSelector {
11184 pub this: Box<Expression>,
11185}
11186
11187#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11189#[cfg_attr(feature = "bindings", derive(TS))]
11190pub struct JSONPathSubscript {
11191 pub this: Box<Expression>,
11192}
11193
11194#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11196#[cfg_attr(feature = "bindings", derive(TS))]
11197pub struct JSONPathUnion {
11198 #[serde(default)]
11199 pub expressions: Vec<Expression>,
11200}
11201
11202#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11204#[cfg_attr(feature = "bindings", derive(TS))]
11205pub struct Format {
11206 pub this: Box<Expression>,
11207 #[serde(default)]
11208 pub expressions: Vec<Expression>,
11209}
11210
11211#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11213#[cfg_attr(feature = "bindings", derive(TS))]
11214pub struct JSONKeys {
11215 pub this: Box<Expression>,
11216 #[serde(default)]
11217 pub expression: Option<Box<Expression>>,
11218 #[serde(default)]
11219 pub expressions: Vec<Expression>,
11220}
11221
11222#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11224#[cfg_attr(feature = "bindings", derive(TS))]
11225pub struct JSONKeyValue {
11226 pub this: Box<Expression>,
11227 pub expression: Box<Expression>,
11228}
11229
11230#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11232#[cfg_attr(feature = "bindings", derive(TS))]
11233pub struct JSONKeysAtDepth {
11234 pub this: Box<Expression>,
11235 #[serde(default)]
11236 pub expression: Option<Box<Expression>>,
11237 #[serde(default)]
11238 pub mode: Option<Box<Expression>>,
11239}
11240
11241#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11243#[cfg_attr(feature = "bindings", derive(TS))]
11244pub struct JSONObject {
11245 #[serde(default)]
11246 pub expressions: Vec<Expression>,
11247 #[serde(default)]
11248 pub null_handling: Option<Box<Expression>>,
11249 #[serde(default)]
11250 pub unique_keys: Option<Box<Expression>>,
11251 #[serde(default)]
11252 pub return_type: Option<Box<Expression>>,
11253 #[serde(default)]
11254 pub encoding: Option<Box<Expression>>,
11255}
11256
11257#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11259#[cfg_attr(feature = "bindings", derive(TS))]
11260pub struct JSONObjectAgg {
11261 #[serde(default)]
11262 pub expressions: Vec<Expression>,
11263 #[serde(default)]
11264 pub null_handling: Option<Box<Expression>>,
11265 #[serde(default)]
11266 pub unique_keys: Option<Box<Expression>>,
11267 #[serde(default)]
11268 pub return_type: Option<Box<Expression>>,
11269 #[serde(default)]
11270 pub encoding: Option<Box<Expression>>,
11271}
11272
11273#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11275#[cfg_attr(feature = "bindings", derive(TS))]
11276pub struct JSONBObjectAgg {
11277 pub this: Box<Expression>,
11278 pub expression: Box<Expression>,
11279}
11280
11281#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11283#[cfg_attr(feature = "bindings", derive(TS))]
11284pub struct JSONArray {
11285 #[serde(default)]
11286 pub expressions: Vec<Expression>,
11287 #[serde(default)]
11288 pub null_handling: Option<Box<Expression>>,
11289 #[serde(default)]
11290 pub return_type: Option<Box<Expression>>,
11291 #[serde(default)]
11292 pub strict: Option<Box<Expression>>,
11293}
11294
11295#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11297#[cfg_attr(feature = "bindings", derive(TS))]
11298pub struct JSONArrayAgg {
11299 pub this: Box<Expression>,
11300 #[serde(default)]
11301 pub order: Option<Box<Expression>>,
11302 #[serde(default)]
11303 pub null_handling: Option<Box<Expression>>,
11304 #[serde(default)]
11305 pub return_type: Option<Box<Expression>>,
11306 #[serde(default)]
11307 pub strict: Option<Box<Expression>>,
11308}
11309
11310#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11312#[cfg_attr(feature = "bindings", derive(TS))]
11313pub struct JSONExists {
11314 pub this: Box<Expression>,
11315 #[serde(default)]
11316 pub path: Option<Box<Expression>>,
11317 #[serde(default)]
11318 pub passing: Option<Box<Expression>>,
11319 #[serde(default)]
11320 pub on_condition: Option<Box<Expression>>,
11321 #[serde(default)]
11322 pub from_dcolonqmark: Option<Box<Expression>>,
11323}
11324
11325#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11327#[cfg_attr(feature = "bindings", derive(TS))]
11328pub struct JSONColumnDef {
11329 #[serde(default)]
11330 pub this: Option<Box<Expression>>,
11331 #[serde(default)]
11332 pub kind: Option<String>,
11333 #[serde(default)]
11334 pub path: Option<Box<Expression>>,
11335 #[serde(default)]
11336 pub nested_schema: Option<Box<Expression>>,
11337 #[serde(default)]
11338 pub ordinality: Option<Box<Expression>>,
11339}
11340
11341#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11343#[cfg_attr(feature = "bindings", derive(TS))]
11344pub struct JSONSchema {
11345 #[serde(default)]
11346 pub expressions: Vec<Expression>,
11347}
11348
11349#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11351#[cfg_attr(feature = "bindings", derive(TS))]
11352pub struct JSONSet {
11353 pub this: Box<Expression>,
11354 #[serde(default)]
11355 pub expressions: Vec<Expression>,
11356}
11357
11358#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11360#[cfg_attr(feature = "bindings", derive(TS))]
11361pub struct JSONStripNulls {
11362 pub this: Box<Expression>,
11363 #[serde(default)]
11364 pub expression: Option<Box<Expression>>,
11365 #[serde(default)]
11366 pub include_arrays: Option<Box<Expression>>,
11367 #[serde(default)]
11368 pub remove_empty: Option<Box<Expression>>,
11369}
11370
11371#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11373#[cfg_attr(feature = "bindings", derive(TS))]
11374pub struct JSONValue {
11375 pub this: Box<Expression>,
11376 #[serde(default)]
11377 pub path: Option<Box<Expression>>,
11378 #[serde(default)]
11379 pub returning: Option<Box<Expression>>,
11380 #[serde(default)]
11381 pub on_condition: Option<Box<Expression>>,
11382}
11383
11384#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11386#[cfg_attr(feature = "bindings", derive(TS))]
11387pub struct JSONValueArray {
11388 pub this: Box<Expression>,
11389 #[serde(default)]
11390 pub expression: Option<Box<Expression>>,
11391}
11392
11393#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11395#[cfg_attr(feature = "bindings", derive(TS))]
11396pub struct JSONRemove {
11397 pub this: Box<Expression>,
11398 #[serde(default)]
11399 pub expressions: Vec<Expression>,
11400}
11401
11402#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11404#[cfg_attr(feature = "bindings", derive(TS))]
11405pub struct JSONTable {
11406 pub this: Box<Expression>,
11407 #[serde(default)]
11408 pub schema: Option<Box<Expression>>,
11409 #[serde(default)]
11410 pub path: Option<Box<Expression>>,
11411 #[serde(default)]
11412 pub error_handling: Option<Box<Expression>>,
11413 #[serde(default)]
11414 pub empty_handling: Option<Box<Expression>>,
11415}
11416
11417#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11419#[cfg_attr(feature = "bindings", derive(TS))]
11420pub struct JSONType {
11421 pub this: Box<Expression>,
11422 #[serde(default)]
11423 pub expression: Option<Box<Expression>>,
11424}
11425
11426#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11428#[cfg_attr(feature = "bindings", derive(TS))]
11429pub struct ObjectInsert {
11430 pub this: Box<Expression>,
11431 #[serde(default)]
11432 pub key: Option<Box<Expression>>,
11433 #[serde(default)]
11434 pub value: Option<Box<Expression>>,
11435 #[serde(default)]
11436 pub update_flag: Option<Box<Expression>>,
11437}
11438
11439#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11441#[cfg_attr(feature = "bindings", derive(TS))]
11442pub struct OpenJSONColumnDef {
11443 pub this: Box<Expression>,
11444 pub kind: String,
11445 #[serde(default)]
11446 pub path: Option<Box<Expression>>,
11447 #[serde(default)]
11448 pub as_json: Option<Box<Expression>>,
11449 #[serde(default, skip_serializing_if = "Option::is_none")]
11451 pub data_type: Option<DataType>,
11452}
11453
11454#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11456#[cfg_attr(feature = "bindings", derive(TS))]
11457pub struct OpenJSON {
11458 pub this: Box<Expression>,
11459 #[serde(default)]
11460 pub path: Option<Box<Expression>>,
11461 #[serde(default)]
11462 pub expressions: Vec<Expression>,
11463}
11464
11465#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11467#[cfg_attr(feature = "bindings", derive(TS))]
11468pub struct JSONBExists {
11469 pub this: Box<Expression>,
11470 #[serde(default)]
11471 pub path: Option<Box<Expression>>,
11472}
11473
11474#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11476#[cfg_attr(feature = "bindings", derive(TS))]
11477pub struct JSONCast {
11478 pub this: Box<Expression>,
11479 pub to: DataType,
11480}
11481
11482#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11484#[cfg_attr(feature = "bindings", derive(TS))]
11485pub struct JSONExtract {
11486 pub this: Box<Expression>,
11487 pub expression: Box<Expression>,
11488 #[serde(default)]
11489 pub only_json_types: Option<Box<Expression>>,
11490 #[serde(default)]
11491 pub expressions: Vec<Expression>,
11492 #[serde(default)]
11493 pub variant_extract: Option<Box<Expression>>,
11494 #[serde(default)]
11495 pub json_query: Option<Box<Expression>>,
11496 #[serde(default)]
11497 pub option: Option<Box<Expression>>,
11498 #[serde(default)]
11499 pub quote: Option<Box<Expression>>,
11500 #[serde(default)]
11501 pub on_condition: Option<Box<Expression>>,
11502 #[serde(default)]
11503 pub requires_json: Option<Box<Expression>>,
11504}
11505
11506#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11508#[cfg_attr(feature = "bindings", derive(TS))]
11509pub struct JSONExtractQuote {
11510 #[serde(default)]
11511 pub option: Option<Box<Expression>>,
11512 #[serde(default)]
11513 pub scalar: Option<Box<Expression>>,
11514}
11515
11516#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11518#[cfg_attr(feature = "bindings", derive(TS))]
11519pub struct JSONExtractArray {
11520 pub this: Box<Expression>,
11521 #[serde(default)]
11522 pub expression: Option<Box<Expression>>,
11523}
11524
11525#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11527#[cfg_attr(feature = "bindings", derive(TS))]
11528pub struct JSONExtractScalar {
11529 pub this: Box<Expression>,
11530 pub expression: Box<Expression>,
11531 #[serde(default)]
11532 pub only_json_types: Option<Box<Expression>>,
11533 #[serde(default)]
11534 pub expressions: Vec<Expression>,
11535 #[serde(default)]
11536 pub json_type: Option<Box<Expression>>,
11537 #[serde(default)]
11538 pub scalar_only: Option<Box<Expression>>,
11539}
11540
11541#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11543#[cfg_attr(feature = "bindings", derive(TS))]
11544pub struct JSONBExtractScalar {
11545 pub this: Box<Expression>,
11546 pub expression: Box<Expression>,
11547 #[serde(default)]
11548 pub json_type: Option<Box<Expression>>,
11549}
11550
11551#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11553#[cfg_attr(feature = "bindings", derive(TS))]
11554pub struct JSONFormat {
11555 #[serde(default)]
11556 pub this: Option<Box<Expression>>,
11557 #[serde(default)]
11558 pub options: Vec<Expression>,
11559 #[serde(default)]
11560 pub is_json: Option<Box<Expression>>,
11561 #[serde(default)]
11562 pub to_json: Option<Box<Expression>>,
11563}
11564
11565#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11567#[cfg_attr(feature = "bindings", derive(TS))]
11568pub struct JSONArrayAppend {
11569 pub this: Box<Expression>,
11570 #[serde(default)]
11571 pub expressions: Vec<Expression>,
11572}
11573
11574#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11576#[cfg_attr(feature = "bindings", derive(TS))]
11577pub struct JSONArrayContains {
11578 pub this: Box<Expression>,
11579 pub expression: Box<Expression>,
11580 #[serde(default)]
11581 pub json_type: Option<Box<Expression>>,
11582}
11583
11584#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11586#[cfg_attr(feature = "bindings", derive(TS))]
11587pub struct JSONArrayInsert {
11588 pub this: Box<Expression>,
11589 #[serde(default)]
11590 pub expressions: Vec<Expression>,
11591}
11592
11593#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11595#[cfg_attr(feature = "bindings", derive(TS))]
11596pub struct ParseJSON {
11597 pub this: Box<Expression>,
11598 #[serde(default)]
11599 pub expression: Option<Box<Expression>>,
11600 #[serde(default)]
11601 pub safe: Option<Box<Expression>>,
11602}
11603
11604#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11606#[cfg_attr(feature = "bindings", derive(TS))]
11607pub struct ParseUrl {
11608 pub this: Box<Expression>,
11609 #[serde(default)]
11610 pub part_to_extract: Option<Box<Expression>>,
11611 #[serde(default)]
11612 pub key: Option<Box<Expression>>,
11613 #[serde(default)]
11614 pub permissive: Option<Box<Expression>>,
11615}
11616
11617#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11619#[cfg_attr(feature = "bindings", derive(TS))]
11620pub struct ParseIp {
11621 pub this: Box<Expression>,
11622 #[serde(default)]
11623 pub type_: Option<Box<Expression>>,
11624 #[serde(default)]
11625 pub permissive: Option<Box<Expression>>,
11626}
11627
11628#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11630#[cfg_attr(feature = "bindings", derive(TS))]
11631pub struct ParseTime {
11632 pub this: Box<Expression>,
11633 pub format: String,
11634}
11635
11636#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11638#[cfg_attr(feature = "bindings", derive(TS))]
11639pub struct ParseDatetime {
11640 pub this: Box<Expression>,
11641 #[serde(default)]
11642 pub format: Option<String>,
11643 #[serde(default)]
11644 pub zone: Option<Box<Expression>>,
11645}
11646
11647#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11649#[cfg_attr(feature = "bindings", derive(TS))]
11650pub struct Map {
11651 #[serde(default)]
11652 pub keys: Vec<Expression>,
11653 #[serde(default)]
11654 pub values: Vec<Expression>,
11655}
11656
11657#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11659#[cfg_attr(feature = "bindings", derive(TS))]
11660pub struct MapCat {
11661 pub this: Box<Expression>,
11662 pub expression: Box<Expression>,
11663}
11664
11665#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11667#[cfg_attr(feature = "bindings", derive(TS))]
11668pub struct MapDelete {
11669 pub this: Box<Expression>,
11670 #[serde(default)]
11671 pub expressions: Vec<Expression>,
11672}
11673
11674#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11676#[cfg_attr(feature = "bindings", derive(TS))]
11677pub struct MapInsert {
11678 pub this: Box<Expression>,
11679 #[serde(default)]
11680 pub key: Option<Box<Expression>>,
11681 #[serde(default)]
11682 pub value: Option<Box<Expression>>,
11683 #[serde(default)]
11684 pub update_flag: Option<Box<Expression>>,
11685}
11686
11687#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11689#[cfg_attr(feature = "bindings", derive(TS))]
11690pub struct MapPick {
11691 pub this: Box<Expression>,
11692 #[serde(default)]
11693 pub expressions: Vec<Expression>,
11694}
11695
11696#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11698#[cfg_attr(feature = "bindings", derive(TS))]
11699pub struct ScopeResolution {
11700 #[serde(default)]
11701 pub this: Option<Box<Expression>>,
11702 pub expression: Box<Expression>,
11703}
11704
11705#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11707#[cfg_attr(feature = "bindings", derive(TS))]
11708pub struct Slice {
11709 #[serde(default)]
11710 pub this: Option<Box<Expression>>,
11711 #[serde(default)]
11712 pub expression: Option<Box<Expression>>,
11713 #[serde(default)]
11714 pub step: Option<Box<Expression>>,
11715}
11716
11717#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11719#[cfg_attr(feature = "bindings", derive(TS))]
11720pub struct VarMap {
11721 #[serde(default)]
11722 pub keys: Vec<Expression>,
11723 #[serde(default)]
11724 pub values: Vec<Expression>,
11725}
11726
11727#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11729#[cfg_attr(feature = "bindings", derive(TS))]
11730pub struct MatchAgainst {
11731 pub this: Box<Expression>,
11732 #[serde(default)]
11733 pub expressions: Vec<Expression>,
11734 #[serde(default)]
11735 pub modifier: Option<Box<Expression>>,
11736}
11737
11738#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11740#[cfg_attr(feature = "bindings", derive(TS))]
11741pub struct MD5Digest {
11742 pub this: Box<Expression>,
11743 #[serde(default)]
11744 pub expressions: Vec<Expression>,
11745}
11746
11747#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11749#[cfg_attr(feature = "bindings", derive(TS))]
11750pub struct Monthname {
11751 pub this: Box<Expression>,
11752 #[serde(default)]
11753 pub abbreviated: Option<Box<Expression>>,
11754}
11755
11756#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11758#[cfg_attr(feature = "bindings", derive(TS))]
11759pub struct Ntile {
11760 #[serde(default)]
11761 pub this: Option<Box<Expression>>,
11762}
11763
11764#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11766#[cfg_attr(feature = "bindings", derive(TS))]
11767pub struct Normalize {
11768 pub this: Box<Expression>,
11769 #[serde(default)]
11770 pub form: Option<Box<Expression>>,
11771 #[serde(default)]
11772 pub is_casefold: Option<Box<Expression>>,
11773}
11774
11775#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11777#[cfg_attr(feature = "bindings", derive(TS))]
11778pub struct Normal {
11779 pub this: Box<Expression>,
11780 #[serde(default)]
11781 pub stddev: Option<Box<Expression>>,
11782 #[serde(default)]
11783 pub gen: Option<Box<Expression>>,
11784}
11785
11786#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11788#[cfg_attr(feature = "bindings", derive(TS))]
11789pub struct Predict {
11790 pub this: Box<Expression>,
11791 pub expression: Box<Expression>,
11792 #[serde(default)]
11793 pub params_struct: Option<Box<Expression>>,
11794}
11795
11796#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11798#[cfg_attr(feature = "bindings", derive(TS))]
11799pub struct MLTranslate {
11800 pub this: Box<Expression>,
11801 pub expression: Box<Expression>,
11802 #[serde(default)]
11803 pub params_struct: Option<Box<Expression>>,
11804}
11805
11806#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11808#[cfg_attr(feature = "bindings", derive(TS))]
11809pub struct FeaturesAtTime {
11810 pub this: Box<Expression>,
11811 #[serde(default)]
11812 pub time: Option<Box<Expression>>,
11813 #[serde(default)]
11814 pub num_rows: Option<Box<Expression>>,
11815 #[serde(default)]
11816 pub ignore_feature_nulls: Option<Box<Expression>>,
11817}
11818
11819#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11821#[cfg_attr(feature = "bindings", derive(TS))]
11822pub struct GenerateEmbedding {
11823 pub this: Box<Expression>,
11824 pub expression: Box<Expression>,
11825 #[serde(default)]
11826 pub params_struct: Option<Box<Expression>>,
11827 #[serde(default)]
11828 pub is_text: Option<Box<Expression>>,
11829}
11830
11831#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11833#[cfg_attr(feature = "bindings", derive(TS))]
11834pub struct MLForecast {
11835 pub this: Box<Expression>,
11836 #[serde(default)]
11837 pub expression: Option<Box<Expression>>,
11838 #[serde(default)]
11839 pub params_struct: Option<Box<Expression>>,
11840}
11841
11842#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11844#[cfg_attr(feature = "bindings", derive(TS))]
11845pub struct ModelAttribute {
11846 pub this: Box<Expression>,
11847 pub expression: Box<Expression>,
11848}
11849
11850#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11852#[cfg_attr(feature = "bindings", derive(TS))]
11853pub struct VectorSearch {
11854 pub this: Box<Expression>,
11855 #[serde(default)]
11856 pub column_to_search: Option<Box<Expression>>,
11857 #[serde(default)]
11858 pub query_table: Option<Box<Expression>>,
11859 #[serde(default)]
11860 pub query_column_to_search: Option<Box<Expression>>,
11861 #[serde(default)]
11862 pub top_k: Option<Box<Expression>>,
11863 #[serde(default)]
11864 pub distance_type: Option<Box<Expression>>,
11865 #[serde(default)]
11866 pub options: Vec<Expression>,
11867}
11868
11869#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11871#[cfg_attr(feature = "bindings", derive(TS))]
11872pub struct Quantile {
11873 pub this: Box<Expression>,
11874 #[serde(default)]
11875 pub quantile: Option<Box<Expression>>,
11876}
11877
11878#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11880#[cfg_attr(feature = "bindings", derive(TS))]
11881pub struct ApproxQuantile {
11882 pub this: Box<Expression>,
11883 #[serde(default)]
11884 pub quantile: Option<Box<Expression>>,
11885 #[serde(default)]
11886 pub accuracy: Option<Box<Expression>>,
11887 #[serde(default)]
11888 pub weight: Option<Box<Expression>>,
11889 #[serde(default)]
11890 pub error_tolerance: Option<Box<Expression>>,
11891}
11892
11893#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11895#[cfg_attr(feature = "bindings", derive(TS))]
11896pub struct ApproxPercentileEstimate {
11897 pub this: Box<Expression>,
11898 #[serde(default)]
11899 pub percentile: Option<Box<Expression>>,
11900}
11901
11902#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11904#[cfg_attr(feature = "bindings", derive(TS))]
11905pub struct Randn {
11906 #[serde(default)]
11907 pub this: Option<Box<Expression>>,
11908}
11909
11910#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11912#[cfg_attr(feature = "bindings", derive(TS))]
11913pub struct Randstr {
11914 pub this: Box<Expression>,
11915 #[serde(default)]
11916 pub generator: Option<Box<Expression>>,
11917}
11918
11919#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11921#[cfg_attr(feature = "bindings", derive(TS))]
11922pub struct RangeN {
11923 pub this: Box<Expression>,
11924 #[serde(default)]
11925 pub expressions: Vec<Expression>,
11926 #[serde(default)]
11927 pub each: Option<Box<Expression>>,
11928}
11929
11930#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11932#[cfg_attr(feature = "bindings", derive(TS))]
11933pub struct RangeBucket {
11934 pub this: Box<Expression>,
11935 pub expression: Box<Expression>,
11936}
11937
11938#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11940#[cfg_attr(feature = "bindings", derive(TS))]
11941pub struct ReadCSV {
11942 pub this: Box<Expression>,
11943 #[serde(default)]
11944 pub expressions: Vec<Expression>,
11945}
11946
11947#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11949#[cfg_attr(feature = "bindings", derive(TS))]
11950pub struct ReadParquet {
11951 #[serde(default)]
11952 pub expressions: Vec<Expression>,
11953}
11954
11955#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11957#[cfg_attr(feature = "bindings", derive(TS))]
11958pub struct Reduce {
11959 pub this: Box<Expression>,
11960 #[serde(default)]
11961 pub initial: Option<Box<Expression>>,
11962 #[serde(default)]
11963 pub merge: Option<Box<Expression>>,
11964 #[serde(default)]
11965 pub finish: Option<Box<Expression>>,
11966}
11967
11968#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11970#[cfg_attr(feature = "bindings", derive(TS))]
11971pub struct RegexpExtractAll {
11972 pub this: Box<Expression>,
11973 pub expression: Box<Expression>,
11974 #[serde(default)]
11975 pub group: Option<Box<Expression>>,
11976 #[serde(default)]
11977 pub parameters: Option<Box<Expression>>,
11978 #[serde(default)]
11979 pub position: Option<Box<Expression>>,
11980 #[serde(default)]
11981 pub occurrence: Option<Box<Expression>>,
11982}
11983
11984#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11986#[cfg_attr(feature = "bindings", derive(TS))]
11987pub struct RegexpILike {
11988 pub this: Box<Expression>,
11989 pub expression: Box<Expression>,
11990 #[serde(default)]
11991 pub flag: Option<Box<Expression>>,
11992}
11993
11994#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11996#[cfg_attr(feature = "bindings", derive(TS))]
11997pub struct RegexpFullMatch {
11998 pub this: Box<Expression>,
11999 pub expression: Box<Expression>,
12000 #[serde(default)]
12001 pub options: Vec<Expression>,
12002}
12003
12004#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12006#[cfg_attr(feature = "bindings", derive(TS))]
12007pub struct RegexpInstr {
12008 pub this: Box<Expression>,
12009 pub expression: Box<Expression>,
12010 #[serde(default)]
12011 pub position: Option<Box<Expression>>,
12012 #[serde(default)]
12013 pub occurrence: Option<Box<Expression>>,
12014 #[serde(default)]
12015 pub option: Option<Box<Expression>>,
12016 #[serde(default)]
12017 pub parameters: Option<Box<Expression>>,
12018 #[serde(default)]
12019 pub group: Option<Box<Expression>>,
12020}
12021
12022#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12024#[cfg_attr(feature = "bindings", derive(TS))]
12025pub struct RegexpSplit {
12026 pub this: Box<Expression>,
12027 pub expression: Box<Expression>,
12028 #[serde(default)]
12029 pub limit: Option<Box<Expression>>,
12030}
12031
12032#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12034#[cfg_attr(feature = "bindings", derive(TS))]
12035pub struct RegexpCount {
12036 pub this: Box<Expression>,
12037 pub expression: Box<Expression>,
12038 #[serde(default)]
12039 pub position: Option<Box<Expression>>,
12040 #[serde(default)]
12041 pub parameters: Option<Box<Expression>>,
12042}
12043
12044#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12046#[cfg_attr(feature = "bindings", derive(TS))]
12047pub struct RegrValx {
12048 pub this: Box<Expression>,
12049 pub expression: Box<Expression>,
12050}
12051
12052#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12054#[cfg_attr(feature = "bindings", derive(TS))]
12055pub struct RegrValy {
12056 pub this: Box<Expression>,
12057 pub expression: Box<Expression>,
12058}
12059
12060#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12062#[cfg_attr(feature = "bindings", derive(TS))]
12063pub struct RegrAvgy {
12064 pub this: Box<Expression>,
12065 pub expression: Box<Expression>,
12066}
12067
12068#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12070#[cfg_attr(feature = "bindings", derive(TS))]
12071pub struct RegrAvgx {
12072 pub this: Box<Expression>,
12073 pub expression: Box<Expression>,
12074}
12075
12076#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12078#[cfg_attr(feature = "bindings", derive(TS))]
12079pub struct RegrCount {
12080 pub this: Box<Expression>,
12081 pub expression: Box<Expression>,
12082}
12083
12084#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12086#[cfg_attr(feature = "bindings", derive(TS))]
12087pub struct RegrIntercept {
12088 pub this: Box<Expression>,
12089 pub expression: Box<Expression>,
12090}
12091
12092#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12094#[cfg_attr(feature = "bindings", derive(TS))]
12095pub struct RegrR2 {
12096 pub this: Box<Expression>,
12097 pub expression: Box<Expression>,
12098}
12099
12100#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12102#[cfg_attr(feature = "bindings", derive(TS))]
12103pub struct RegrSxx {
12104 pub this: Box<Expression>,
12105 pub expression: Box<Expression>,
12106}
12107
12108#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12110#[cfg_attr(feature = "bindings", derive(TS))]
12111pub struct RegrSxy {
12112 pub this: Box<Expression>,
12113 pub expression: Box<Expression>,
12114}
12115
12116#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12118#[cfg_attr(feature = "bindings", derive(TS))]
12119pub struct RegrSyy {
12120 pub this: Box<Expression>,
12121 pub expression: Box<Expression>,
12122}
12123
12124#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12126#[cfg_attr(feature = "bindings", derive(TS))]
12127pub struct RegrSlope {
12128 pub this: Box<Expression>,
12129 pub expression: Box<Expression>,
12130}
12131
12132#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12134#[cfg_attr(feature = "bindings", derive(TS))]
12135pub struct SafeAdd {
12136 pub this: Box<Expression>,
12137 pub expression: Box<Expression>,
12138}
12139
12140#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12142#[cfg_attr(feature = "bindings", derive(TS))]
12143pub struct SafeDivide {
12144 pub this: Box<Expression>,
12145 pub expression: Box<Expression>,
12146}
12147
12148#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12150#[cfg_attr(feature = "bindings", derive(TS))]
12151pub struct SafeMultiply {
12152 pub this: Box<Expression>,
12153 pub expression: Box<Expression>,
12154}
12155
12156#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12158#[cfg_attr(feature = "bindings", derive(TS))]
12159pub struct SafeSubtract {
12160 pub this: Box<Expression>,
12161 pub expression: Box<Expression>,
12162}
12163
12164#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12166#[cfg_attr(feature = "bindings", derive(TS))]
12167pub struct SHA2 {
12168 pub this: Box<Expression>,
12169 #[serde(default)]
12170 pub length: Option<i64>,
12171}
12172
12173#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12175#[cfg_attr(feature = "bindings", derive(TS))]
12176pub struct SHA2Digest {
12177 pub this: Box<Expression>,
12178 #[serde(default)]
12179 pub length: Option<i64>,
12180}
12181
12182#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12184#[cfg_attr(feature = "bindings", derive(TS))]
12185pub struct SortArray {
12186 pub this: Box<Expression>,
12187 #[serde(default)]
12188 pub asc: Option<Box<Expression>>,
12189 #[serde(default)]
12190 pub nulls_first: Option<Box<Expression>>,
12191}
12192
12193#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12195#[cfg_attr(feature = "bindings", derive(TS))]
12196pub struct SplitPart {
12197 pub this: Box<Expression>,
12198 #[serde(default)]
12199 pub delimiter: Option<Box<Expression>>,
12200 #[serde(default)]
12201 pub part_index: Option<Box<Expression>>,
12202}
12203
12204#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12206#[cfg_attr(feature = "bindings", derive(TS))]
12207pub struct SubstringIndex {
12208 pub this: Box<Expression>,
12209 #[serde(default)]
12210 pub delimiter: Option<Box<Expression>>,
12211 #[serde(default)]
12212 pub count: Option<Box<Expression>>,
12213}
12214
12215#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12217#[cfg_attr(feature = "bindings", derive(TS))]
12218pub struct StandardHash {
12219 pub this: Box<Expression>,
12220 #[serde(default)]
12221 pub expression: Option<Box<Expression>>,
12222}
12223
12224#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12226#[cfg_attr(feature = "bindings", derive(TS))]
12227pub struct StrPosition {
12228 pub this: Box<Expression>,
12229 #[serde(default)]
12230 pub substr: Option<Box<Expression>>,
12231 #[serde(default)]
12232 pub position: Option<Box<Expression>>,
12233 #[serde(default)]
12234 pub occurrence: Option<Box<Expression>>,
12235}
12236
12237#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12239#[cfg_attr(feature = "bindings", derive(TS))]
12240pub struct Search {
12241 pub this: Box<Expression>,
12242 pub expression: Box<Expression>,
12243 #[serde(default)]
12244 pub json_scope: Option<Box<Expression>>,
12245 #[serde(default)]
12246 pub analyzer: Option<Box<Expression>>,
12247 #[serde(default)]
12248 pub analyzer_options: Option<Box<Expression>>,
12249 #[serde(default)]
12250 pub search_mode: Option<Box<Expression>>,
12251}
12252
12253#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12255#[cfg_attr(feature = "bindings", derive(TS))]
12256pub struct SearchIp {
12257 pub this: Box<Expression>,
12258 pub expression: Box<Expression>,
12259}
12260
12261#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12263#[cfg_attr(feature = "bindings", derive(TS))]
12264pub struct StrToDate {
12265 pub this: Box<Expression>,
12266 #[serde(default)]
12267 pub format: Option<String>,
12268 #[serde(default)]
12269 pub safe: Option<Box<Expression>>,
12270}
12271
12272#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12274#[cfg_attr(feature = "bindings", derive(TS))]
12275pub struct StrToTime {
12276 pub this: Box<Expression>,
12277 pub format: String,
12278 #[serde(default)]
12279 pub zone: Option<Box<Expression>>,
12280 #[serde(default)]
12281 pub safe: Option<Box<Expression>>,
12282 #[serde(default)]
12283 pub target_type: Option<Box<Expression>>,
12284}
12285
12286#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12288#[cfg_attr(feature = "bindings", derive(TS))]
12289pub struct StrToUnix {
12290 #[serde(default)]
12291 pub this: Option<Box<Expression>>,
12292 #[serde(default)]
12293 pub format: Option<String>,
12294}
12295
12296#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12298#[cfg_attr(feature = "bindings", derive(TS))]
12299pub struct StrToMap {
12300 pub this: Box<Expression>,
12301 #[serde(default)]
12302 pub pair_delim: Option<Box<Expression>>,
12303 #[serde(default)]
12304 pub key_value_delim: Option<Box<Expression>>,
12305 #[serde(default)]
12306 pub duplicate_resolution_callback: Option<Box<Expression>>,
12307}
12308
12309#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12311#[cfg_attr(feature = "bindings", derive(TS))]
12312pub struct NumberToStr {
12313 pub this: Box<Expression>,
12314 pub format: String,
12315 #[serde(default)]
12316 pub culture: Option<Box<Expression>>,
12317}
12318
12319#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12321#[cfg_attr(feature = "bindings", derive(TS))]
12322pub struct FromBase {
12323 pub this: Box<Expression>,
12324 pub expression: Box<Expression>,
12325}
12326
12327#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12329#[cfg_attr(feature = "bindings", derive(TS))]
12330pub struct Stuff {
12331 pub this: Box<Expression>,
12332 #[serde(default)]
12333 pub start: Option<Box<Expression>>,
12334 #[serde(default)]
12335 pub length: Option<i64>,
12336 pub expression: Box<Expression>,
12337}
12338
12339#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12341#[cfg_attr(feature = "bindings", derive(TS))]
12342pub struct TimeToStr {
12343 pub this: Box<Expression>,
12344 pub format: String,
12345 #[serde(default)]
12346 pub culture: Option<Box<Expression>>,
12347 #[serde(default)]
12348 pub zone: Option<Box<Expression>>,
12349}
12350
12351#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12353#[cfg_attr(feature = "bindings", derive(TS))]
12354pub struct TimeStrToTime {
12355 pub this: Box<Expression>,
12356 #[serde(default)]
12357 pub zone: Option<Box<Expression>>,
12358}
12359
12360#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12362#[cfg_attr(feature = "bindings", derive(TS))]
12363pub struct TsOrDsAdd {
12364 pub this: Box<Expression>,
12365 pub expression: Box<Expression>,
12366 #[serde(default)]
12367 pub unit: Option<String>,
12368 #[serde(default)]
12369 pub return_type: Option<Box<Expression>>,
12370}
12371
12372#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12374#[cfg_attr(feature = "bindings", derive(TS))]
12375pub struct TsOrDsDiff {
12376 pub this: Box<Expression>,
12377 pub expression: Box<Expression>,
12378 #[serde(default)]
12379 pub unit: Option<String>,
12380}
12381
12382#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12384#[cfg_attr(feature = "bindings", derive(TS))]
12385pub struct TsOrDsToDate {
12386 pub this: Box<Expression>,
12387 #[serde(default)]
12388 pub format: Option<String>,
12389 #[serde(default)]
12390 pub safe: Option<Box<Expression>>,
12391}
12392
12393#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12395#[cfg_attr(feature = "bindings", derive(TS))]
12396pub struct TsOrDsToTime {
12397 pub this: Box<Expression>,
12398 #[serde(default)]
12399 pub format: Option<String>,
12400 #[serde(default)]
12401 pub safe: Option<Box<Expression>>,
12402}
12403
12404#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12406#[cfg_attr(feature = "bindings", derive(TS))]
12407pub struct Unhex {
12408 pub this: Box<Expression>,
12409 #[serde(default)]
12410 pub expression: Option<Box<Expression>>,
12411}
12412
12413#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12415#[cfg_attr(feature = "bindings", derive(TS))]
12416pub struct Uniform {
12417 pub this: Box<Expression>,
12418 pub expression: Box<Expression>,
12419 #[serde(default)]
12420 pub gen: Option<Box<Expression>>,
12421 #[serde(default)]
12422 pub seed: Option<Box<Expression>>,
12423}
12424
12425#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12427#[cfg_attr(feature = "bindings", derive(TS))]
12428pub struct UnixToStr {
12429 pub this: Box<Expression>,
12430 #[serde(default)]
12431 pub format: Option<String>,
12432}
12433
12434#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12436#[cfg_attr(feature = "bindings", derive(TS))]
12437pub struct UnixToTime {
12438 pub this: Box<Expression>,
12439 #[serde(default)]
12440 pub scale: Option<i64>,
12441 #[serde(default)]
12442 pub zone: Option<Box<Expression>>,
12443 #[serde(default)]
12444 pub hours: Option<Box<Expression>>,
12445 #[serde(default)]
12446 pub minutes: Option<Box<Expression>>,
12447 #[serde(default)]
12448 pub format: Option<String>,
12449 #[serde(default)]
12450 pub target_type: Option<Box<Expression>>,
12451}
12452
12453#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12455#[cfg_attr(feature = "bindings", derive(TS))]
12456pub struct Uuid {
12457 #[serde(default)]
12458 pub this: Option<Box<Expression>>,
12459 #[serde(default)]
12460 pub name: Option<String>,
12461 #[serde(default)]
12462 pub is_string: Option<Box<Expression>>,
12463}
12464
12465#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12467#[cfg_attr(feature = "bindings", derive(TS))]
12468pub struct TimestampFromParts {
12469 #[serde(default)]
12470 pub zone: Option<Box<Expression>>,
12471 #[serde(default)]
12472 pub milli: Option<Box<Expression>>,
12473 #[serde(default)]
12474 pub this: Option<Box<Expression>>,
12475 #[serde(default)]
12476 pub expression: Option<Box<Expression>>,
12477}
12478
12479#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12481#[cfg_attr(feature = "bindings", derive(TS))]
12482pub struct TimestampTzFromParts {
12483 #[serde(default)]
12484 pub zone: Option<Box<Expression>>,
12485}
12486
12487#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12489#[cfg_attr(feature = "bindings", derive(TS))]
12490pub struct Corr {
12491 pub this: Box<Expression>,
12492 pub expression: Box<Expression>,
12493 #[serde(default)]
12494 pub null_on_zero_variance: Option<Box<Expression>>,
12495}
12496
12497#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12499#[cfg_attr(feature = "bindings", derive(TS))]
12500pub struct WidthBucket {
12501 pub this: Box<Expression>,
12502 #[serde(default)]
12503 pub min_value: Option<Box<Expression>>,
12504 #[serde(default)]
12505 pub max_value: Option<Box<Expression>>,
12506 #[serde(default)]
12507 pub num_buckets: Option<Box<Expression>>,
12508 #[serde(default)]
12509 pub threshold: Option<Box<Expression>>,
12510}
12511
12512#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12514#[cfg_attr(feature = "bindings", derive(TS))]
12515pub struct CovarSamp {
12516 pub this: Box<Expression>,
12517 pub expression: Box<Expression>,
12518}
12519
12520#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12522#[cfg_attr(feature = "bindings", derive(TS))]
12523pub struct CovarPop {
12524 pub this: Box<Expression>,
12525 pub expression: Box<Expression>,
12526}
12527
12528#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12530#[cfg_attr(feature = "bindings", derive(TS))]
12531pub struct Week {
12532 pub this: Box<Expression>,
12533 #[serde(default)]
12534 pub mode: Option<Box<Expression>>,
12535}
12536
12537#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12539#[cfg_attr(feature = "bindings", derive(TS))]
12540pub struct XMLElement {
12541 pub this: Box<Expression>,
12542 #[serde(default)]
12543 pub expressions: Vec<Expression>,
12544 #[serde(default)]
12545 pub evalname: Option<Box<Expression>>,
12546}
12547
12548#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12550#[cfg_attr(feature = "bindings", derive(TS))]
12551pub struct XMLGet {
12552 pub this: Box<Expression>,
12553 pub expression: Box<Expression>,
12554 #[serde(default)]
12555 pub instance: Option<Box<Expression>>,
12556}
12557
12558#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12560#[cfg_attr(feature = "bindings", derive(TS))]
12561pub struct XMLTable {
12562 pub this: Box<Expression>,
12563 #[serde(default)]
12564 pub namespaces: Option<Box<Expression>>,
12565 #[serde(default)]
12566 pub passing: Option<Box<Expression>>,
12567 #[serde(default)]
12568 pub columns: Vec<Expression>,
12569 #[serde(default)]
12570 pub by_ref: Option<Box<Expression>>,
12571}
12572
12573#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12575#[cfg_attr(feature = "bindings", derive(TS))]
12576pub struct XMLKeyValueOption {
12577 pub this: Box<Expression>,
12578 #[serde(default)]
12579 pub expression: Option<Box<Expression>>,
12580}
12581
12582#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12584#[cfg_attr(feature = "bindings", derive(TS))]
12585pub struct Zipf {
12586 pub this: Box<Expression>,
12587 #[serde(default)]
12588 pub elementcount: Option<Box<Expression>>,
12589 #[serde(default)]
12590 pub gen: Option<Box<Expression>>,
12591}
12592
12593#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12595#[cfg_attr(feature = "bindings", derive(TS))]
12596pub struct Merge {
12597 pub this: Box<Expression>,
12598 pub using: Box<Expression>,
12599 #[serde(default)]
12600 pub on: Option<Box<Expression>>,
12601 #[serde(default)]
12602 pub using_cond: Option<Box<Expression>>,
12603 #[serde(default)]
12604 pub whens: Option<Box<Expression>>,
12605 #[serde(default)]
12606 pub with_: Option<Box<Expression>>,
12607 #[serde(default)]
12608 pub returning: Option<Box<Expression>>,
12609}
12610
12611#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12613#[cfg_attr(feature = "bindings", derive(TS))]
12614pub struct When {
12615 #[serde(default)]
12616 pub matched: Option<Box<Expression>>,
12617 #[serde(default)]
12618 pub source: Option<Box<Expression>>,
12619 #[serde(default)]
12620 pub condition: Option<Box<Expression>>,
12621 pub then: Box<Expression>,
12622}
12623
12624#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12626#[cfg_attr(feature = "bindings", derive(TS))]
12627pub struct Whens {
12628 #[serde(default)]
12629 pub expressions: Vec<Expression>,
12630}
12631
12632#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12634#[cfg_attr(feature = "bindings", derive(TS))]
12635pub struct NextValueFor {
12636 pub this: Box<Expression>,
12637 #[serde(default)]
12638 pub order: Option<Box<Expression>>,
12639}
12640
12641#[cfg(test)]
12642mod tests {
12643 use super::*;
12644
12645 #[test]
12646 #[cfg(feature = "bindings")]
12647 fn export_typescript_types() {
12648 Expression::export_all(&ts_rs::Config::default())
12651 .expect("Failed to export Expression types");
12652 }
12653
12654 #[test]
12655 fn test_simple_select_builder() {
12656 let select = Select::new()
12657 .column(Expression::star())
12658 .from(Expression::Table(TableRef::new("users")));
12659
12660 assert_eq!(select.expressions.len(), 1);
12661 assert!(select.from.is_some());
12662 }
12663
12664 #[test]
12665 fn test_expression_alias() {
12666 let expr = Expression::column("id").alias("user_id");
12667
12668 match expr {
12669 Expression::Alias(a) => {
12670 assert_eq!(a.alias.name, "user_id");
12671 }
12672 _ => panic!("Expected Alias"),
12673 }
12674 }
12675
12676 #[test]
12677 fn test_literal_creation() {
12678 let num = Expression::number(42);
12679 let str = Expression::string("hello");
12680
12681 match num {
12682 Expression::Literal(Literal::Number(n)) => assert_eq!(n, "42"),
12683 _ => panic!("Expected Number"),
12684 }
12685
12686 match str {
12687 Expression::Literal(Literal::String(s)) => assert_eq!(s, "hello"),
12688 _ => panic!("Expected String"),
12689 }
12690 }
12691
12692 #[test]
12693 fn test_expression_sql() {
12694 let expr = crate::parse_one("SELECT 1 + 2", crate::DialectType::Generic).unwrap();
12695 assert_eq!(expr.sql(), "SELECT 1 + 2");
12696 }
12697
12698 #[test]
12699 fn test_expression_sql_for() {
12700 let expr = crate::parse_one("SELECT IF(x > 0, 1, 0)", crate::DialectType::Generic).unwrap();
12701 let sql = expr.sql_for(crate::DialectType::Generic);
12702 assert!(sql.contains("CASE WHEN"), "Expected CASE WHEN in: {}", sql);
12704 }
12705}