-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
80d492b
commit 52fa270
Showing
14 changed files
with
116 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
|
||
namespace Staudenmeir\EloquentJsonRelations\Grammars; | ||
|
||
use Illuminate\Database\ConnectionInterface; | ||
use Illuminate\Database\Query\Grammars\SQLiteGrammar as Base; | ||
use RuntimeException; | ||
|
||
class SqliteGrammar extends Base implements JsonGrammar | ||
{ | ||
/** | ||
* Compile a "JSON array" statement into SQL. | ||
* | ||
* @param string $column | ||
* @return string | ||
*/ | ||
public function compileJsonArray($column) | ||
{ | ||
return $this->wrap($column); | ||
} | ||
|
||
/** | ||
* Compile a "JSON object" statement into SQL. | ||
* | ||
* @param string $column | ||
* @param int $levels | ||
* @return string | ||
*/ | ||
public function compileJsonObject($column, $levels) | ||
{ | ||
throw new RuntimeException('This database is not supported.'); // @codeCoverageIgnore | ||
} | ||
|
||
/** | ||
* Compile a "JSON value select" statement into SQL. | ||
* | ||
* @param string $column | ||
* @return string | ||
*/ | ||
public function compileJsonValueSelect(string $column): string | ||
{ | ||
return $this->wrap($column); | ||
} | ||
|
||
/** | ||
* Determine whether the database supports the "member of" operator. | ||
* | ||
* @param \Illuminate\Database\ConnectionInterface $connection | ||
* @return bool | ||
*/ | ||
public function supportsMemberOf(ConnectionInterface $connection): bool | ||
{ | ||
return false; | ||
} | ||
|
||
/** | ||
* Compile a "member of" statement into SQL. | ||
* | ||
* @param string $column | ||
* @param string|null $objectKey | ||
* @param mixed $value | ||
* @return string | ||
*/ | ||
public function compileMemberOf(string $column, ?string $objectKey, mixed $value): string | ||
{ | ||
throw new RuntimeException('This database is not supported.'); // @codeCoverageIgnore | ||
} | ||
|
||
/** | ||
* Prepare the bindings for a "member of" statement. | ||
* | ||
* @param mixed $value | ||
* @return array | ||
*/ | ||
public function prepareBindingsForMemberOf(mixed $value): array | ||
{ | ||
throw new RuntimeException('This database is not supported.'); // @codeCoverageIgnore | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.