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

TypeDefinition
WhereInputmap<anydata>
OrderByInputmap<SortDirection>
SelectInputmap<anydata>
IncludeInputmap<anydata>
AggregateInputmap<anydata>

Query model types

TypePurpose
QueryOperationAllowed operation constants (FIND_MANY, CREATE, etc.)
QueryPlanInternal operation plan built by query builders
UpsertInput{create, update} payload for upsert plan
SqlQuery{text, parameters} structure for parameterized raw SQL
TypePurpose
ClientConfigConstructor configuration
NormalizedClientConfigParsed runtime config
ParsedConnectionUrlURL parsing output
ClientErrorDetailStructured error payload
ClientErrorClient subsystem error type
NativeDbClientUnion of native mysql/postgresql clients
ConnectionPoolConfigAlias to sql:ConnectionPool

Default ports

ballerina
public const DEFAULT_MYSQL_PORT = 3306;
public const DEFAULT_POSTGRESQL_PORT = 5432;