Skip to content

Commit

Permalink
Update sql-type methods and reg-ex constraint for SQLite.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfang90739 committed Dec 10, 2024
1 parent 658e864 commit 41104f2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions stix2/datastore/relational_db/database_backends/sqlite_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ def determine_sql_type_for_hex_property(): # noqa: F811
# return LargeBinary
return SQLiteBackend.determine_sql_type_for_string_property()

@staticmethod
def determine_sql_type_for_reference_property(): # noqa: F811
return Text

@staticmethod
def determine_sql_type_for_string_property(): # noqa: F811
return Text

@staticmethod
def determine_sql_type_for_key_as_id(): # noqa: F811
return Text

@staticmethod
def determine_sql_type_for_timestamp_property(): # noqa: F811
return TIMESTAMP(timezone=True)
Expand All @@ -49,3 +61,7 @@ def determine_sql_type_for_timestamp_property(): # noqa: F811
@staticmethod
def array_allowed():
return False

@staticmethod
def create_regex_constraint_expression(column_name, pattern):
return f"{column_name} ~ {pattern}"

0 comments on commit 41104f2

Please sign in to comment.