Types Reference
Engine constants and type
ballerina
public const MYSQL = "MYSQL";
public const POSTGRESQL = "POSTGRESQL";
public type Engine MYSQL|POSTGRESQL;Relation constants and type
ballerina
public const ONE_TO_ONE = "ONE_TO_ONE";
public const ONE_TO_MANY = "ONE_TO_MANY";
public const MANY_TO_ONE = "MANY_TO_ONE";
public const MANY_TO_MANY = "MANY_TO_MANY";
public type RelationType ONE_TO_ONE|ONE_TO_MANY|MANY_TO_ONE|MANY_TO_MANY;Sort constants and type
ballerina
public const ASC = "ASC";
public const DESC = "DESC";
public type SortDirection ASC|DESC;Query payload aliases
| Type | Definition |
|---|---|
WhereInput | map<anydata> |
OrderByInput | map<SortDirection> |
SelectInput | map<anydata> |
IncludeInput | map<anydata> |
AggregateInput | map<anydata> |
Query model types
| Type | Purpose |
|---|---|
QueryOperation | Allowed operation constants (FIND_MANY, CREATE, etc.) |
QueryPlan | Internal operation plan built by query builders |
UpsertInput | {create, update} payload for upsert plan |
SqlQuery | {text, parameters} structure for parameterized raw SQL |
Client-related types
| Type | Purpose |
|---|---|
ClientConfig | Constructor configuration |
NormalizedClientConfig | Parsed runtime config |
ParsedConnectionUrl | URL parsing output |
ClientErrorDetail | Structured error payload |
ClientError | Client subsystem error type |
NativeDbClient | Union of native mysql/postgresql clients |
ConnectionPoolConfig | Alias to sql:ConnectionPool |
Default ports
ballerina
public const DEFAULT_MYSQL_PORT = 3306;
public const DEFAULT_POSTGRESQL_PORT = 5432;