-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Milestone
Description
This is the file i had in mind:
-- Test mapping of various SQL column types and properties to C++ types.
CREATE TABLE IF NOT EXISTS ColumnTypeTest1 (
-- primary keys
integerAutoincrementPK INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
-- nullability
integerNotNull INTEGER NOT NULL,
integerNull INTEGER NULL,
-- various column types
tinyIntColumn TINYINT NULL,
smallIntColumn SMALLINT NULL,
integerColumn INTEGER NULL,
bigIntColumn BIGINT NULL,
numericColumn NUMERIC(10, 2) NULL,
booleanColumn BOOLEAN NULL,
dateColumn DATE NULL,
timestampColumn TIMESTAMP NULL,
datetimeColumn DATETIME NULL,
charColumn CHAR(8) NULL,
varcharColumn VARCHAR(30) NULL,
textColumn TEXT NULL,
blobColumn BLOB NULL,
binaryColumn BINARY(16) NULL,
varBinaryColumn VARBINARY(16) NULL,
-- Unicode column types
nCharColumn NCHAR(8) NULL,
nVarCharColumn NVARCHAR(30) NULL,
nTextColumn NTEXT NULL
);
CREATE TABLE IF NOT EXISTS ColumnTypeTest2 (
-- primary keys
guidPK GUID NOT NULL PRIMARY KEY
);
CREATE TABLE IF NOT EXISTS ColumnTypeTest3 (
-- primary keys
varcharPK VARCHAR(30) NOT NULL PRIMARY KEY
);@Yaraslaut but now I realize that this is not quite working in the way we're currently doing the tests, because this is SQL dialect dependant, and thus, we cannot run that test on every database, but only on hard-coded SQLite (as done right now).
Some column names and properties may however differ, depending on the dialect. Would it make sense to move the actual logic of ddl2cpp into the core library and then ahve a way to run the tests in C++, using the migration query builder API? 🤔