44 return '(' . implode(
') || (', $stringList ) .
')';
54 $glue = $all ?
' UNION ALL ' :
' UNION ';
56 return implode( $glue, $sqls );
68 $params = [ $input, $startPosition ];
69 if ( $length !==
null ) {
72 return 'SUBSTR(' . implode(
',',
$params ) .
')';
81 return 'CAST ( ' . $field .
' AS TEXT )';
84 public function tableName(
string $name, $format =
'quoted' ) {
85 if ( preg_match(
'/^sqlite_[a-z_]+$/', $name ) ) {
90 return parent::tableName( $name, $format );
95 foreach ( $options as $k => $v ) {
96 if ( is_numeric( $k ) && ( $v ===
'FOR UPDATE' || $v ===
'LOCK IN SHARE MODE' ) ) {
101 return parent::makeSelectOptions( $options );
105 $delim, $tables, $field, $conds =
'', $join_conds = []
107 $fld =
"group_concat($field," . $this->quoter->addQuotes( $delim ) .
')';
109 return '(' . $this->
selectSQLText( $tables, $fld, $conds, static::CALLER_SUBQUERY, [], $join_conds ) .
')';
113 return [
'INSERT OR IGNORE INTO',
'' ];
121 $options = parent::makeUpdateOptionsArray( $options );
122 $options = $this->rewriteIgnoreKeyword( $options );
131 private function rewriteIgnoreKeyword( $options ) {
132 # SQLite uses OR IGNORE not just IGNORE
133 foreach ( $options as $k => $v ) {
134 if ( $v ==
'IGNORE' ) {
135 $options[$k] =
'OR IGNORE';
144 return "DROP TABLE " . $this->
tableName( $table );
148 return parent::isTransactableQuery( $sql ) && !in_array(
150 [
'ATTACH',
'PRAGMA' ],
array $params
The job parameters.