Skip to content

Commit 41104f2

Browse files
committed
Update sql-type methods and reg-ex constraint for SQLite.
1 parent 658e864 commit 41104f2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

stix2/datastore/relational_db/database_backends/sqlite_backend.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ def determine_sql_type_for_hex_property(): # noqa: F811
3939
# return LargeBinary
4040
return SQLiteBackend.determine_sql_type_for_string_property()
4141

42+
@staticmethod
43+
def determine_sql_type_for_reference_property(): # noqa: F811
44+
return Text
45+
46+
@staticmethod
47+
def determine_sql_type_for_string_property(): # noqa: F811
48+
return Text
49+
50+
@staticmethod
51+
def determine_sql_type_for_key_as_id(): # noqa: F811
52+
return Text
53+
4254
@staticmethod
4355
def determine_sql_type_for_timestamp_property(): # noqa: F811
4456
return TIMESTAMP(timezone=True)
@@ -49,3 +61,7 @@ def determine_sql_type_for_timestamp_property(): # noqa: F811
4961
@staticmethod
5062
def array_allowed():
5163
return False
64+
65+
@staticmethod
66+
def create_regex_constraint_expression(column_name, pattern):
67+
return f"{column_name} ~ {pattern}"

0 commit comments

Comments
 (0)