mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
added test for inserts with timestamp + constraints (#2244)
This commit is contained in:
parent
5c74b64722
commit
4261c60a17
3 changed files with 36 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -83,3 +83,4 @@ staticcheck.conf
|
|||
dax/dax-data
|
||||
|
||||
coverage-from-docker
|
||||
*.client_id.txt
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ var TableTests []TableTest = []TableTest{
|
|||
stringScalarFunctionsTests,
|
||||
|
||||
insertTest,
|
||||
insertTimestampTest,
|
||||
keyedInsertTest,
|
||||
timestampLiterals,
|
||||
unaryOpExprWithInt,
|
||||
|
|
|
|||
|
|
@ -154,3 +154,37 @@ var insertTest = TableTest{
|
|||
},
|
||||
},
|
||||
}
|
||||
|
||||
var insertTimestampTest = TableTest{
|
||||
SQLTests: []SQLTest{
|
||||
{
|
||||
SQLs: sqls(
|
||||
"CREATE TABLE insertTimestampTest (_id id, time timestamp timeunit 'ms' epoch '2022-01-01T00:00:00Z', ids idset, strings stringset);",
|
||||
),
|
||||
ExpHdrs: hdrs(),
|
||||
ExpRows: rows(),
|
||||
Compare: CompareExactUnordered,
|
||||
},
|
||||
{
|
||||
SQLs: sqls(
|
||||
"INSERT INTO insertTimestampTest(_id, time, ids, strings) VALUES (1, '2023-01-01', [6 , 1, 9], ['red', 'blue', 'green']);",
|
||||
),
|
||||
ExpHdrs: hdrs(),
|
||||
ExpRows: rows(),
|
||||
Compare: CompareExactUnordered,
|
||||
},
|
||||
{
|
||||
SQLs: sqls(
|
||||
"select time from insertTimestampTest;",
|
||||
),
|
||||
ExpHdrs: hdrs(
|
||||
hdr("time", fldTypeTimestamp),
|
||||
),
|
||||
ExpRows: rows(
|
||||
row(timestampFromString("2023-01-01T00:00:00Z")),
|
||||
),
|
||||
Compare: CompareExactUnordered,
|
||||
SortStringKeys: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue