I found the simple dialect that Rebol/command used was quite sufficient.
And if you wanted something different, you could create that yourself as long as you got the sql statement correct for your DB before you inserted it into the port.
I've changed the sql server ODBC test script to run against Firebird 3.0
There are a number of datatypes that are not supported which I've commented out.
And all the tests fail because I need to fix the equality test but at least it's now completing without errors except the memory leak one
DROP TABLE "bit"
name: => bit
sqltype: => "BOOLEAN"
content: => ["TRUE" "FALSE"]
CREATE TABLE "bit" (id integer generated by default as identity primary key, "value" BOOLEAN NOT NULL)
INSERT INTO "bit" ("value") VALUES (TRUE)
INSERT INTO "bit" ("value") VALUES (FALSE)
SELECT * FROM "bit"
[1 2]
["TRUE" "FALSE"]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "smallint_s"
name: => smallint_s
sqltype: => "SMALLINT"
content: => [-32768 -10 0 10 32767]
CREATE TABLE "smallint_s" (id integer generated by default as identity primary key, "value" SMALLINT NOT NULL)
INSERT INTO "smallint_s" ("value") VALUES (-32768)
INSERT INTO "smallint_s" ("value") VALUES (-10)
INSERT INTO "smallint_s" ("value") VALUES (0)
INSERT INTO "smallint_s" ("value") VALUES (10)
INSERT INTO "smallint_s" ("value") VALUES (32767)
SELECT * FROM "smallint_s"
[1 2 3 4 5]
[-32768 -10 0 10 32767]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "integer_s"
name: => integer_s
sqltype: => "INT"
content: => [-2147483648 -10 0 10 2147483647]
CREATE TABLE "integer_s" (id integer generated by default as identity primary key, "value" INT NOT NULL)
INSERT INTO "integer_s" ("value") VALUES (-2147483648)
INSERT INTO "integer_s" ("value") VALUES (-10)
INSERT INTO "integer_s" ("value") VALUES (0)
INSERT INTO "integer_s" ("value") VALUES (10)
INSERT INTO "integer_s" ("value") VALUES (2147483647)
SELECT * FROM "integer_s"
[1 2 3 4 5]
[-2147483648 -10 0 10 2147483647]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "bigint_s"
name: => bigint_s
sqltype: => "BIGINT"
content: => [-9223372036854775808 -10 0 10 9223372036854775807]
CREATE TABLE "bigint_s" (id integer generated by default as identity primary key, "value" BIGINT NOT NULL)
INSERT INTO "bigint_s" ("value") VALUES (-9223372036854775808)
INSERT INTO "bigint_s" ("value") VALUES (-10)
INSERT INTO "bigint_s" ("value") VALUES (0)
INSERT INTO "bigint_s" ("value") VALUES (10)
INSERT INTO "bigint_s" ("value") VALUES (9223372036854775807)
SELECT * FROM "bigint_s"
[1 2 3 4 5]
[-9223372036854775808 -10 0 10 9223372036854775807]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "double"
name: => double
sqltype: => "DOUBLE PRECISION"
content: => [-3.4 -1.2 0.0 5.6 7.8]
CREATE TABLE "double" (id integer generated by default as identity primary key, "value" DOUBLE PRECISION NOT NULL)
INSERT INTO "double" ("value") VALUES (-3.4)
INSERT INTO "double" ("value") VALUES (-1.2)
INSERT INTO "double" ("value") VALUES (0.0)
INSERT INTO "double" ("value") VALUES (5.6)
INSERT INTO "double" ("value") VALUES (7.8)
SELECT * FROM "double"
[1 2 3 4 5]
[-3.4 -1.2 0.0 5.6 7.8]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "float"
name: => float
sqltype: => "FLOAT(20)"
content: => [-3.4 -1.2 0.0 5.6 7.8]
CREATE TABLE "float" (id integer generated by default as identity primary key, "value" FLOAT(20) NOT NULL)
INSERT INTO "float" ("value") VALUES (-3.4)
INSERT INTO "float" ("value") VALUES (-1.2)
INSERT INTO "float" ("value") VALUES (0.0)
INSERT INTO "float" ("value") VALUES (5.6)
INSERT INTO "float" ("value") VALUES (7.8)
SELECT * FROM "float"
[1 2 3 4 5]
[-3.4 -1.2 0.0 5.6 7.8]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "numeric"
name: => numeric
sqltype: => "NUMERIC(18,2)"
content: => [-3.4 -1.2 0.0 5.6 7.8]
CREATE TABLE "numeric" (id integer generated by default as identity primary key, "value" NUMERIC(18,2) NOT NULL)
INSERT INTO "numeric" ("value") VALUES (-3.4)
INSERT INTO "numeric" ("value") VALUES (-1.2)
INSERT INTO "numeric" ("value") VALUES (0.0)
INSERT INTO "numeric" ("value") VALUES (5.6)
INSERT INTO "numeric" ("value") VALUES (7.8)
SELECT * FROM "numeric"
[1 2 3 4 5]
[-3.4 -1.2 0.0 5.6 7.8]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "decimal"
name: => decimal
sqltype: => "DECIMAL(3,2)"
content: => [-3.4 -1.2 0.0 5.6 7.8]
CREATE TABLE "decimal" (id integer generated by default as identity primary key, "value" DECIMAL(3,2) NOT NULL)
INSERT INTO "decimal" ("value") VALUES (-3.4)
INSERT INTO "decimal" ("value") VALUES (-1.2)
INSERT INTO "decimal" ("value") VALUES (0.0)
INSERT INTO "decimal" ("value") VALUES (5.6)
INSERT INTO "decimal" ("value") VALUES (7.8)
SELECT * FROM "decimal"
[1 2 3 4 5]
[-3.4 -1.2 0.0 5.6 7.8]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "date"
name: => date
sqltype: => "TIMESTAMP"
content: => ["'12-Dec-2012'" "'21-Apr-1975'"]
CREATE TABLE "date" (id integer generated by default as identity primary key, "value" TIMESTAMP NOT NULL)
INSERT INTO "date" ("value") VALUES ('12-Dec-2012')
INSERT INTO "date" ("value") VALUES ('21-Apr-1975')
SELECT * FROM "date"
[1 2]
["'12-Dec-2012'" "'21-Apr-1975'"]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "time"
name: => time
sqltype: => "TIME"
content: => ["'10:00'" "'03:04:00.123'"]
CREATE TABLE "time" (id integer generated by default as identity primary key, "value" TIME NOT NULL)
INSERT INTO "time" ("value") VALUES ('10:00')
INSERT INTO "time" ("value") VALUES ('03:04:00.123')
SELECT * FROM "time"
[1 2]
["'10:00'" "'03:04:00.123'"]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "timestamp"
name: => timestamp
sqltype: => "TIMESTAMP"
content: => ["'30-May-2017 14:23:08'" "'12-Dec-2012'"]
CREATE TABLE "timestamp" (id integer generated by default as identity primary key, "value" TIMESTAMP NOT NULL)
INSERT INTO "timestamp" ("value") VALUES ('30-May-2017 14:23:08')
INSERT INTO "timestamp" ("value") VALUES ('12-Dec-2012')
SELECT * FROM "timestamp"
[1 2]
["'30-May-2017 14:23:08'" "'12-Dec-2012'"]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "char"
name: => char
sqltype: => "CHAR(3)"
content: => ["'abc'" "'def'" "'ghi'"]
CREATE TABLE "char" (id integer generated by default as identity primary key, "value" CHAR(3) NOT NULL)
INSERT INTO "char" ("value") VALUES ('abc')
INSERT INTO "char" ("value") VALUES ('def')
INSERT INTO "char" ("value") VALUES ('ghi')
SELECT * FROM "char"
[1 2 3]
["'abc'" "'def'" "'ghi'"]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "varchar"
name: => varchar
sqltype: => "VARCHAR(10)"
content: => ["''" "'abc'" "'defgh'" "'jklmnopqrs'"]
CREATE TABLE "varchar" (id integer generated by default as identity primary key, "value" VARCHAR(10) NOT NULL)
INSERT INTO "varchar" ("value") VALUES ('')
INSERT INTO "varchar" ("value") VALUES ('abc')
INSERT INTO "varchar" ("value") VALUES ('defgh')
INSERT INTO "varchar" ("value") VALUES ('jklmnopqrs')
SELECT * FROM "varchar"
[1 2 3 4]
["''" "'abc'" "'defgh'" "'jklmnopqrs'"]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "nchar"
name: => nchar
sqltype: => "NCHAR(3)"
content: => ["'abc'" "'ταБ'" "'ghi'"]
CREATE TABLE "nchar" (id integer generated by default as identity primary key, "value" NCHAR(3) NOT NULL)
INSERT INTO "nchar" ("value") VALUES ('abc')
INSERT INTO "nchar" ("value") VALUES ('ταБ')
INSERT INTO "nchar" ("value") VALUES ('ghi')
SELECT * FROM "nchar"
[1 2 3]
["'abc'" "'ταБ'" "'ghi'"]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "nvarchar"
name: => nvarchar
sqltype: => "VARCHAR(10)"
content: => ["''" "'abc'" "'ταБЬℓσ'" "'٩(●̮̮̃•̃)۶'"]
CREATE TABLE "nvarchar" (id integer generated by default as identity primary key, "value" VARCHAR(10) NOT NULL)
INSERT INTO "nvarchar" ("value") VALUES ('')
INSERT INTO "nvarchar" ("value") VALUES ('abc')
INSERT INTO "nvarchar" ("value") VALUES ('ταБЬℓσ')
INSERT INTO "nvarchar" ("value") VALUES ('٩(●̮̮̃•̃)۶')
SELECT * FROM "nvarchar"
[1 2 3 4]
["''" "'abc'" "'ταБЬℓσ'" "'٩(●̮̮̃•̃)۶'"]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "binary"
name: => binary
sqltype: => "CHAR(3)"
content: => ["x'00'" "x'010203'" "x'FFFFFF'"]
CREATE TABLE "binary" (id integer generated by default as identity primary key, "value" CHAR(3) NOT NULL)
INSERT INTO "binary" ("value") VALUES (x'00')
INSERT INTO "binary" ("value") VALUES (x'010203')
INSERT INTO "binary" ("value") VALUES (x'FFFFFF')
SELECT * FROM "binary"
[1 2 3]
["x'00'" "x'010203'" "x'FFFFFF'"]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "varbinary"
name: => varbinary
sqltype: => "char(10)"
content: => ["x''" "x'010203'" "x'DECAFBADCAFE'"]
CREATE TABLE "varbinary" (id integer generated by default as identity primary key, "value" char(10) NOT NULL)
INSERT INTO "varbinary" ("value") VALUES (x'')
INSERT INTO "varbinary" ("value") VALUES (x'010203')
INSERT INTO "varbinary" ("value") VALUES (x'DECAFBADCAFE')
SELECT * FROM "varbinary"
[1 2 3]
["x''" "x'010203'" "x'DECAFBADCAFE'"]
QUERY DID NOT MATCH ORIGINAL DATA
DROP TABLE "blob"
name: => blob
sqltype: => "BLOB(10)"
content: => ["x''" "x'010203'" "x'DECAFBADCAFE'"]
CREATE TABLE "blob" (id integer generated by default as identity primary key, "value" BLOB(10) NOT NULL)
INSERT INTO "blob" ("value") VALUES (x'')
INSERT INTO "blob" ("value") VALUES (x'010203')
INSERT INTO "blob" ("value") VALUES (x'DECAFBADCAFE')
SELECT * FROM "blob"
[1 2 3]
["x''" "x'010203'" "x'DECAFBADCAFE'"]
QUERY DID NOT MATCH ORIGINAL DATA
*** PG_Mem_Usage = 2147483896 ***
Memory accounting imbalance: Rebol internally tracks how much
memory it uses to know when to garbage collect, etc. For
some reason this accounting did not balance to zero on exit.
Run under Valgrind with --leak-check=full --track-origins=yes
to find out why this is happening.
The other issue I've noted is that a lock on the database file is present even though the connection is closed. I have to quit rebol before the lock is released.
C:\Users\Graham\rebol3\odbc>r3-core odb-test.reb
s: => {DROP TABLE "REBBIT"}
name: => bit
sqltype: => "BOOLEAN"
content: => [true false true]
s: => {CREATE TABLE "REBBIT" (ID integer, "SQLVALUE" BOOLEAN NOT NULL)}
s: => {CREATE GENERATOR "INCBIT"}
s: => {CREATE TRIGGER autoinc FOR REBBIT ACTIVE BEFORE INSERT POSITION 0 AS BEGIN NEW.ID = GEN_ID(incbit, 1); END}
s: => {INSERT INTO "REBBIT" ("SQLVALUE") VALUES (TRUE)}
s: => {INSERT INTO "REBBIT" ("SQLVALUE") VALUES (FALSE)}
s: => {INSERT INTO "REBBIT" ("SQLVALUE") VALUES (TRUE)}
s: => {SELECT "SQLVALUE" FROM "REBBIT"}
VAL_TYPE() called on unreadable BLANK!
C Source File C:\Projects\ren-c\src\core\m-pools.c, Line 1528
REBVAL init on tick #126914 at C:\Projects\ren-c\src\extensions\odbc\mod-odbc.c:1105
Kind=32
Containing series for value pointer found, panicking it:
unmanaged series was likely created during evaluator tick: 126914