Errors

Error CodeDescription
E001Unable to infer an appropriate name for the query When you have a query in the code but SQLx-ts is unable to correctly infer a name of the query, refer for more details
E002Failed to fetch query name from annotation This error occurs if the query name from the annotation is malformed. @name should be formatted @name: query name
E003Missing alias when handling functions If you are using a SQL function and expect sqlx-ts to generate the type definition for it, you must provide an alias. For example SELECT COUNT(*) AS the_count
E004Invalid TypeScript file path
E005Failed to handle a wildcard statement without target table in FROM statement For some reason, you have a wildcard selection query SELECT * FROM X but the sqlx-ts is unable to pick up the target table. Please double check the SQL query and make sure the target table FROM exists.
E006Failed to handle a wildcard statement as it reached a dead-end expression You would never hit this error - it would only happen if your wildcard query is not actually a SELECT statement
E007Unsupported table with joins statement detected You would never reach this unless the query has a malformed FROM statement in your SELECT * query
E008The query contains unknown placeholder parameter symbol MySQL expects ? and PostgreSQL expects $n for query parameter symbols
E009When translating a function in a SELECT clause, you must provide an alias. functions used as part of SELECT must come with an alias
E010Unknown function detected while processing a SELECT clause You are using a SQL function that sqlx-ts does not know
E011table name was not found while processing an identifier FROM is not found in the query