SQL class abstract interface

Base interface for all SQL-generating classes.

The SQL interface defines the contract that all SQL query components must implement. Every class that represents a part of an SQL query (fields, conditions, operators, etc.) must provide a toSQL method that returns the SQL string representation.

This interface also provides utility static methods for common SQL operations.

Example implementations:

class MyCustomSQL implements SQL {
  @override
  String toSQL() => 'CUSTOM SQL HERE';
}

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toSQL() String
Converts this SQL component to its string representation.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

avg(QField alias) QSelectField
Creates an AVG aggregate function with optional alias. alias A QField that specifies the field to average and optional alias. Returns a QSelectField representing the AVG function.
count(QField alias) QSelectField
Creates a COUNT aggregate function with optional alias.
custom(String sql) QSelectField
Creates a custom SQL expression as a selectable field.
max(QField alias) QSelectField
Creates a SUM aggregate function with optional alias. alias A QField that specifies the field to sum and optional alias. Returns a QSelectField representing the SUM function.
min(QField alias) QSelectField
Creates a MIN aggregate function with optional alias. alias A QField that specifies the field to min and optional alias. Returns a QSelectField representing the MIN function.
sum(QField alias) QSelectField
Creates a SUM aggregate function with optional alias. alias A QField that specifies the field to sum and optional alias. Returns a QSelectField representing the SUM function.