Defines custom error classes for SQL mapper library operations.
// Source: https://github.com/platformatic/platformatic | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import createError from '@fastify/error'
export const ERROR_PREFIX = 'PLT_SQL_MAPPER'
export const CannotFindEntityError = createError(`${ERROR_PREFIX}_CANNOT_FIND_ENTITY`, 'Cannot find entity %s')
export const SpecifyProtocolError = createError(
`${ERROR_PREFIX}_SPECIFY_PROTOCOLS`,
'You must specify either postgres, mysql or sqlite as protocols'
)
export const ConnectionStringRequiredError = createError(
`${ERROR_PREFIX}_CONNECTION_STRING_REQUIRED`,
'connectionString is required'
)
export const TableMustBeAStringError = createError(
`${ERROR_PREFIX}_TABLE_MUST_BE_A_
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key