Skip to content

Commit ddf36d4

Browse files
committed
add REGEXP constraint to sqlite
1 parent aa41ecb commit ddf36d4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

stix2/datastore/relational_db/database_backends/sqlite_backend.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,11 @@ def determine_sql_type_for_timestamp_property(): # noqa: F811
5757
def array_allowed():
5858
return False
5959

60-
def create_regex_constraint_expression(self, column_name, pattern):
61-
return None
62-
63-
def create_regex_constraint_and_expression(self, clause1, clause2):
64-
return None
60+
def create_regex_constraint_clause(self, column_name, pattern):
61+
return f"{column_name} REGEXP {pattern}"
6562

6663
@staticmethod
6764
def next_id(data_sink):
68-
# hack, which is nit reliable
65+
# hack, which is not reliable, must look for a better solution
6966
SQLiteBackend.temp_sequence_count += 1
7067
return SQLiteBackend.temp_sequence_count

0 commit comments

Comments
 (0)