Initial SQLite development (#1)

Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
2024-06-08 23:58:45 +00:00
parent e91acee70f
commit f784f3e52c
66 changed files with 5509 additions and 2 deletions

48
src/Op.php Normal file
View File

@@ -0,0 +1,48 @@
<?php declare(strict_types=1);
namespace BitBadger\PDODocument;
/**
* The types of logical operations allowed for JSON fields
*/
enum Op
{
/** Equals (=) */
case EQ;
/** Greater Than (>) */
case GT;
/** Greater Than or Equal To (>=) */
case GE;
/** Less Than (<) */
case LT;
/** Less Than or Equal To (<=) */
case LE;
/** Not Equal to (<>) */
case NE;
/** Between (BETWEEN) */
case BT;
/** Exists (IS NOT NULL) */
case EX;
/** Does Not Exist (IS NULL) */
case NEX;
/**
* Get the string representation of this operator
*
* @return string The operator to use in SQL statements
*/
public function toString(): string
{
return match ($this) {
Op::EQ => "=",
Op::GT => ">",
Op::GE => ">=",
Op::LT => "<",
Op::LE => "<=",
Op::NE => "<>",
Op::BT => "BETWEEN",
Op::EX => "IS NOT NULL",
Op::NEX => "IS NULL"
};
}
}