Skip to main content

Database Expression

A database expression is used in Persistence Mappings to define the location of data in a database.

Table Expression

Specification

{
"schemaName": "<string>",
"tableName": "<string>"
}

Structure values

Field NameTypeDescriptionRequiredDefault
schemaNameStringThe name of the schema in the database in which the table resides.Optional
tableNameStringThe name of the table.Required

Example

{
"schemaName": "dbo",
"tableName": "transactions"
}

Query Expression

Specification

{
"query": "<string>"
}

Structure values

Field NameTypeDescriptionRequiredDefault
queryStringThe SQL query to execute on the database before returning data to Magpie. The query dialect should match the dialect of the database.Required

Example

{
"query": "select * from dbo.transactions where department_id = 4"
}