1515
1616class Sqlite3Dialect extends Dialect
1717{
18+ #[Override]
1819 public function getConnectionErrorCodes (): array
1920 {
2021 return [10 , 11 , 14 ];
2122 }
2223
24+ #[Override]
2325 public function getErrorCode (array $ errorInfo ): mixed
2426 {
2527 return Arrays::getValue ($ errorInfo , 1 );
2628 }
2729
30+ #[Override]
2831 public function update (): string
2932 {
3033 if ($ this ->query ->aliasTable ) {
@@ -33,6 +36,7 @@ public function update(): string
3336 return parent ::update ();
3437 }
3538
39+ #[Override]
3640 public function join (): string
3741 {
3842 $ any = Arrays::any ($ this ->query ->joinClauses , function (JoinClause $ joinClause ) {
@@ -44,6 +48,7 @@ public function join(): string
4448 return parent ::join ();
4549 }
4650
51+ #[Override]
4752 public function lockForUpdate (): string
4853 {
4954 if ($ this ->query ->lockForUpdate ) {
@@ -52,6 +57,7 @@ public function lockForUpdate(): string
5257 return '' ;
5358 }
5459
60+ #[Override]
5561 public function using (): string
5662 {
5763 if ($ this ->query ->usingClauses ) {
@@ -60,47 +66,56 @@ public function using(): string
6066 return '' ;
6167 }
6268
69+ #[Override]
6370 public function batchInsert (string $ table , string $ primaryKey , $ columns , $ batchSize , ?OnConflict $ onConflict ): string
6471 {
6572 throw new InvalidArgumentException ("Batch insert not supported in sqlite3 " );
6673 }
6774
75+ #[Override]
6876 protected function insertEmptyRow (): string
6977 {
7078 return "INSERT INTO {$ this ->query ->table } DEFAULT VALUES " ;
7179 }
7280
81+ #[Override]
7382 public function regexpMatcher (): string
7483 {
7584 //needs package sqlite3-pcre to work correctly
7685 return 'REGEXP ' ;
7786 }
7887
88+ #[Override]
7989 protected function quote (string $ word ): string
8090 {
8191 return "\"{$ word }\"" ;
8292 }
8393
94+ #[Override]
8495 public function getIteratorOptions (): array
8596 {
8697 return [];
8798 }
8899
100+ #[Override]
89101 public function onConflictUpdate (): string
90102 {
91103 throw new BadMethodCallException ('UPSERT is not supported in sqlite3 ' );
92104 }
93105
106+ #[Override]
94107 public function onConflictDoNothing (): string
95108 {
96109 throw new BadMethodCallException ('On conflict do nothing is not supported in sqlite3 ' );
97110 }
98111
112+ #[Override]
99113 protected function getDistinctOnQuery (): string
100114 {
101115 throw new InvalidArgumentException ("DISTINCT ON is not supported in sqlite3 " );
102116 }
103117
118+ #[Override]
104119 protected function wrapQueryWithDistinctCount (string $ sql ): string
105120 {
106121 throw new InvalidArgumentException ("DISTINCT for COUNT is not supported in sqlite3 " );
0 commit comments