Skip to content

Commit 5bbf8dd

Browse files
authored
fix: Add timestamp type (#10202)
#### Summary Related to koltyakov/cq-source-sharepoint#19 (comment). SQLite doesn't have an official `timestamp` type but the Go lib takes care of it, see mattn/go-sqlite3#748. We had this type in `v1`, see https://github.com/cloudquery/cloudquery/blob/plugins-destination-sqlite-v1.3.6/plugins/destination/sqlite/client/types.go#L58 <!--
1 parent c5d3508 commit 5bbf8dd

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • plugins/destination/sqlite/client

plugins/destination/sqlite/client/types.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ func (*Client) arrowTypeToSqliteStr(t arrow.DataType) string {
1616
return "real"
1717
case arrow.BOOL:
1818
return "boolean"
19+
case arrow.TIMESTAMP:
20+
return "timestamp"
1921
default:
2022
return "text"
2123
}
@@ -33,6 +35,8 @@ func (*Client) arrowTypeToSqlite(t arrow.DataType) arrow.DataType {
3335
return arrow.PrimitiveTypes.Float64
3436
case arrow.BOOL:
3537
return arrow.FixedWidthTypes.Boolean
38+
case arrow.TIMESTAMP:
39+
return arrow.FixedWidthTypes.Timestamp_us
3640
default:
3741
return arrow.BinaryTypes.LargeString
3842
}
@@ -50,7 +54,9 @@ func (*Client) sqliteTypeToArrowType(t string) arrow.DataType {
5054
return arrow.BinaryTypes.LargeBinary
5155
case "boolean":
5256
return arrow.FixedWidthTypes.Boolean
57+
case "timestamp":
58+
return arrow.FixedWidthTypes.Timestamp_us
5359
default:
54-
panic("unknown type")
60+
panic("unknown type: " + t)
5561
}
5662
}

0 commit comments

Comments
 (0)