mirror of
https://github.com/tursodatabase/libsql.git
synced 2024-12-12 15:33:44 +00:00
ad79ef48a2
* add tests * add bench
25 lines
598 B
Plaintext
25 lines
598 B
Plaintext
|
|
DROP TABLE IF EXISTS t1;
|
|
CREATE TABLE t1(a, b TEXT);
|
|
CREATE UNIQUE INDEX IF NOT EXISTS x1 ON t1(b==0);
|
|
CREATE INDEX IF NOT EXISTS x2 ON t1(a || 0) WHERE b;
|
|
INSERT INTO t1(a,b) VALUES('a',1),('a',0);
|
|
SELECT a, b, '|' FROM t1;
|
|
|
|
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1(a TEXT, b REAL);
|
|
CREATE UNIQUE INDEX t1x1 ON t1(a GLOB b);
|
|
INSERT INTO t1(a,b) VALUES('0.0','1'),('1.0','1');
|
|
SELECT * FROM t1;
|
|
REINDEX;
|
|
|
|
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1(a REAL);
|
|
CREATE UNIQUE INDEX index_0 ON t1(TYPEOF(a));
|
|
INSERT OR IGNORE INTO t1(a) VALUES (0.1),(FALSE);
|
|
SELECT * FROM t1;
|
|
REINDEX;
|
|
|