summaryrefslogtreecommitdiffstatshomepage
path: root/src/SemanticScuttle/db/sqlite.querybuilder.php
diff options
context:
space:
mode:
authorGravatar Tom Willemse2024-06-11 00:13:48 -0700
committerGravatar Tom Willemse2024-06-11 00:13:48 -0700
commita959a69a1dd781caa33829db161859c88455911d (patch)
treeac0db2fa23482c6ef5caedd21079bf2f8c9be368 /src/SemanticScuttle/db/sqlite.querybuilder.php
parent9bcc5827388491d37591a86a175f63fa9cd38d41 (diff)
parent85cca718e308779a56dbf302140ce9088fc0727a (diff)
downloadscuttle-a959a69a1dd781caa33829db161859c88455911d.tar.gz
scuttle-a959a69a1dd781caa33829db161859c88455911d.zip
Merge branch 'sqlite-fixes' into oni
Diffstat (limited to 'src/SemanticScuttle/db/sqlite.querybuilder.php')
-rw-r--r--src/SemanticScuttle/db/sqlite.querybuilder.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/SemanticScuttle/db/sqlite.querybuilder.php b/src/SemanticScuttle/db/sqlite.querybuilder.php
new file mode 100644
index 0000000..91cabcf
--- /dev/null
+++ b/src/SemanticScuttle/db/sqlite.querybuilder.php
@@ -0,0 +1,16 @@
+<?php
+require_once 'QueryBuilder.php';
+
+class SQLiteQueryBuilder extends QueryBuilder
+{
+ public function isNotNull($query)
+ {
+ return " IIF({$query}, true, false) ";
+ }
+
+ public function left($query, $length)
+ {
+ $endIndex = $length + 1;
+ return " SUBSTRING({$query}, 0, {$endIndex}) ";
+ }
+}