calligradb: Add support for 22 typical scalar SQL functions
BUG:352631 With minor exceptions these functions now work with SQLite, MySQL, PostgreSQL: *abs(X) *ceiling(X) *char(X1,X2,...,XN) *coalesce(X,Y,...) *floor(X) *greatest(X,Y,...) & alias max(X,Y,...) *hex(X) *ifnull(X,Y) *instr(X,Y) *least(X,Y,...) & alias min(X,Y,...) *length(X) *lower(X) *ltrim(X) & ltrim(X,Y) *nullif(X,Y) *random() & random(X,Y) *replace(X,Y,Z) *round(X) & round(X,Y) *rtrim(X) & rtrim(X,Y) *soundex(X) *trim(X) & trim(X,Y) *unicode(X) *upper(X) In many cases substitute functions are used to make the result work in a portable way. The implementation of function parser supports: * checking number of arguments * checking types of arguments, sometimes "any number" or "any text or BLOB" * checking compatibility of arguments in function * checking relation of value of arguments in function, e.g. value of the first argument smaller than second's * checking NULL arguments in function; then most often the result is NULL * argument overloading or optional arguments, e.g. round(X) and round(X,Y) * displaying of human-readable error messages when the above constraints are not met, for example "Three arguments required" or "Function does not accept any arguments" * easy extensibility using just a few lines of code Note: no extra i18n added; will be added in a KDb port
Showing
- kexi/kexidb/drivers/mysql/mysqldriver.cpp 21 additions, 0 deletionskexi/kexidb/drivers/mysql/mysqldriver.cpp
- kexi/kexidb/drivers/mysql/mysqldriver.h 20 additions, 0 deletionskexi/kexidb/drivers/mysql/mysqldriver.h
- kexi/kexidb/drivers/pqxx/pqxxconnection.cpp 5 additions, 0 deletionskexi/kexidb/drivers/pqxx/pqxxconnection.cpp
- kexi/kexidb/drivers/pqxx/pqxxdriver.cpp 34 additions, 0 deletionskexi/kexidb/drivers/pqxx/pqxxdriver.cpp
- kexi/kexidb/drivers/pqxx/pqxxdriver.h 29 additions, 0 deletionskexi/kexidb/drivers/pqxx/pqxxdriver.h
- libs/db/driver.cpp 54 additions, 1 deletionlibs/db/driver.cpp
- libs/db/driver.h 50 additions, 1 deletionlibs/db/driver.h
- libs/db/driver_p.h 5 additions, 1 deletionlibs/db/driver_p.h
- libs/db/drivers/sqlite/CMakeLists.txt 1 addition, 0 deletionslibs/db/drivers/sqlite/CMakeLists.txt
- libs/db/drivers/sqlite/sqliteconnection.cpp 6 additions, 1 deletionlibs/db/drivers/sqlite/sqliteconnection.cpp
- libs/db/drivers/sqlite/sqliteconnection.h 1 addition, 1 deletionlibs/db/drivers/sqlite/sqliteconnection.h
- libs/db/drivers/sqlite/sqlitedriver.cpp 64 additions, 1 deletionlibs/db/drivers/sqlite/sqlitedriver.cpp
- libs/db/drivers/sqlite/sqlitedriver.h 31 additions, 1 deletionlibs/db/drivers/sqlite/sqlitedriver.h
- libs/db/drivers/sqlite/sqlitefunctions.cpp 114 additions, 0 deletionslibs/db/drivers/sqlite/sqlitefunctions.cpp
- libs/db/drivers/sqlite/sqlitefunctions.h 30 additions, 0 deletionslibs/db/drivers/sqlite/sqlitefunctions.h
- libs/db/expression.cpp 983 additions, 55 deletionslibs/db/expression.cpp
- libs/db/expression.h 18 additions, 0 deletionslibs/db/expression.h
Loading
Please register or sign in to comment