persist

ballerina/persist Ballerina library
Functions
convertToArray
function convertToArray(typedesc<record {}> elementType, record {}[] arr) returns elementType[]
Parameters
- elementType typedesc<record {}> -
- arr record {}[] -
filterRecord
function filterRecord(record {} 'object, string[] fields) returns record {}
getAlreadyExistsError
function getAlreadyExistsError(string entity, anydata key) returns AlreadyExistsError
Generates a new persist:AlreadyExistsError
with the given parameters.
Return Type
- AlreadyExistsError - The generated
persist:AlreadyExistsError
getKey
function getKey(anydata|record {} 'object, string[] keyFields) returns anydata|record {}
getNotFoundError
function getNotFoundError(string entity, anydata key) returns NotFoundError
Generates a new persist:NotFoundError
with the given parameters.
Return Type
- NotFoundError - The generated
persist:NotFoundError
Errors
persist: AlreadyExistsError
Represents an error that occurs when the user attempts to create a record which already exists in the database.
persist: ConstraintViolationError
Represents an error that occurs when an attempt is made to perform an operation, which violates a foreign key constraint.
persist: Error
Defines the generic error type for the persist
module.
persist: NotFoundError
Represents an error that occurs when an attempt is made to retrieve a record using a non-existing key.
Object types
persist: AbstractPersistClient
Represents the abstract persist client. This abstract object is used in the generated client.
Import
import ballerina/persist;
Metadata
Released date: 9 days ago
Version: 1.5.0
License: Apache-2.0
Compatibility
Platform: java21
Ballerina version: 2201.11.0
GraalVM compatible: Yes
Pull count
Total: 1847
Current verison: 0
Weekly downloads
Keywords
persist
Contributors