Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Add support for SQL concat operator, closes #223

davidmezzettifca12b535877
diff --git a/src/python/txtai/database/sql/base.py b/src/python/txtai/database/sql/base.py
index c85529c5..3bfc5312 100644
--- a/src/python/txtai/database/sql/base.py
+++ b/src/python/txtai/database/sql/base.py
@@ -112,7 +112,7 @@ class SQL:
# - Punctuation chars are parsed as standalone tokens which helps identify operators
# - Add additional wordchars to prevent splitting on those values
# - Disable comments
- tokens = shlex(StringIO(query), punctuation_chars="=!<>+-*/%")
+ tokens = shlex(StringIO(query), punctuation_chars="=!<>+-*/%|")
tokens.wordchars += ":@#"
tokens.commenters = ""
tokens = list(tokens)
diff --git a/src/python/txtai/database/sql/token.py b/src/python/txtai/database/sql/token.py
index a8d5b5ed..fbcb61f9 100644
--- a/src/python/txtai/database/sql/token.py
+++ b/src/python/txtai/database/sql/token.py
@@ -12,7 +12,7 @@ class Token:
SIMILAR_TOKEN = "__SIMILAR__"
# Default list of comparison operators
- OPERATORS = ["=", "!=", "<>", ">", ">=", "<", "<=", "+", "-", "*", "/", "%", "not", "between", "like", "is", "null"]
+ OPERATORS = ["=", "!=", "<>", ">", ">=", "<", "<=", "+", "-", "*", "/", "%", "||", "not", "between", "like", "is", "null"]
# Default list of logic separators
LOGIC_SEPARATORS = ["and", "or"]