1313use Yiisoft \Db \Exception \NotSupportedException ;
1414use Yiisoft \Db \Expression \Expression ;
1515use Yiisoft \Db \Expression \ExpressionInterface ;
16- use Yiisoft \Db \QueryBuilder \DMLQueryBuilder as AbstractDMLQueryBuilder ;
17- use Yiisoft \Db \QueryBuilder \QueryBuilderInterface ;
1816use Yiisoft \Db \Query \QueryInterface ;
17+ use Yiisoft \Db \QueryBuilder \AbstractDMLQueryBuilder ;
18+ use Yiisoft \Db \QueryBuilder \QueryBuilderInterface ;
1919use Yiisoft \Db \Schema \QuoterInterface ;
2020use Yiisoft \Db \Schema \SchemaInterface ;
2121
@@ -34,7 +34,19 @@ public function __construct(
3434 }
3535
3636 /**
37- * @throws Exception|Throwable
37+ * @throws Exception
38+ * @throws InvalidArgumentException
39+ * @throws InvalidConfigException
40+ * @throws NotSupportedException
41+ */
42+ public function insertWithReturningPks (string $ table , QueryInterface |array $ columns , array &$ params = []): string
43+ {
44+ throw new NotSupportedException (__METHOD__ . '() is not supported by SQLite. ' );
45+ }
46+
47+ /**
48+ * @throws Exception
49+ * @throws Throwable
3850 */
3951 public function resetSequence (string $ tableName , int |string $ value = null ): string
4052 {
@@ -64,15 +76,19 @@ public function resetSequence(string $tableName, int|string $value = null): stri
6476 }
6577
6678 /**
67- * @throws Exception|InvalidArgumentException|InvalidConfigException|JsonException|NotSupportedException
79+ * @throws Exception
80+ * @throws InvalidArgumentException
81+ * @throws InvalidConfigException
82+ * @throws JsonException
83+ * @throws NotSupportedException
6884 */
6985 public function upsert (
7086 string $ table ,
7187 QueryInterface |array $ insertColumns ,
7288 bool |array $ updateColumns ,
7389 array &$ params
7490 ): string {
75- /** @var Constraint[] $constraints */
91+ /** @psalm- var Constraint[] $constraints */
7692 $ constraints = [];
7793
7894 /**
@@ -91,9 +107,7 @@ public function upsert(
91107 return $ this ->insert ($ table , $ insertColumns , $ params );
92108 }
93109
94- /**
95- * @psalm-var string[] $placeholders
96- */
110+ /** @psalm-var string[] $placeholders */
97111 [, $ placeholders , $ values , $ params ] = $ this ->prepareInsertValues ($ table , $ insertColumns , $ params );
98112
99113 $ insertSql = 'INSERT OR IGNORE INTO '
@@ -110,7 +124,7 @@ public function upsert(
110124
111125 foreach ($ constraints as $ constraint ) {
112126 $ constraintCondition = ['and ' ];
113- /** @psalm-var string[] */
127+ /** @psalm-var string[] $columnsNames */
114128 $ columnsNames = $ constraint ->getColumnNames ();
115129 foreach ($ columnsNames as $ name ) {
116130 $ quotedName = $ this ->quoter ->quoteColumnName ($ name );
@@ -135,7 +149,7 @@ public function upsert(
135149 return $ insertSql ;
136150 }
137151
138- /** @var array $params */
152+ /** @psalm- var array $params */
139153 $ updateSql = 'WITH "EXCLUDED" ( '
140154 . implode (', ' , $ insertNames )
141155 . ') AS ( ' . (!empty ($ placeholders )
0 commit comments