@@ -303,6 +303,10 @@ def supports_optimizer_hints?
303
303
@has_pg_hint_plan
304
304
end
305
305
306
+ def supports_common_table_expressions?
307
+ true
308
+ end
309
+
306
310
def supports_lazy_transactions?
307
311
true
308
312
end
@@ -379,13 +383,19 @@ def exec_insert(sql, name = nil, binds = [], pk = nil, sequence_name = nil)
379
383
end
380
384
end
381
385
386
+ def execute_batch ( statements , name = nil )
387
+ execute ( combine_multi_statements ( statements ) , name )
388
+ end
389
+
382
390
def explain ( arel , binds = [ ] )
383
391
sql , binds = to_sql_and_binds ( arel , binds )
384
392
ActiveRecord ::ConnectionAdapters ::PostgreSQL ::ExplainPrettyPrinter . new . pp ( exec_query ( "EXPLAIN #{ sql } " , 'EXPLAIN' , binds ) )
385
393
end
386
394
387
395
# from ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements
388
- READ_QUERY = ActiveRecord ::ConnectionAdapters ::AbstractAdapter . build_read_query_regexp ( :begin , :commit , :explain , :select , :set , :show , :release , :savepoint , :rollback ) # :nodoc:
396
+ READ_QUERY = ActiveRecord ::ConnectionAdapters ::AbstractAdapter . build_read_query_regexp (
397
+ :begin , :commit , :explain , :select , :set , :show , :release , :savepoint , :rollback , :with
398
+ ) # :nodoc:
389
399
private_constant :READ_QUERY
390
400
391
401
def write_query? ( sql ) # :nodoc:
@@ -434,8 +444,8 @@ def build_insert_sql(insert) # :nodoc:
434
444
sql
435
445
end
436
446
437
- def build_truncate_statements ( * table_names )
438
- "TRUNCATE TABLE #{ table_names . map ( &method ( :quote_table_name ) ) . join ( ", " ) } "
447
+ def build_truncate_statements ( table_names )
448
+ [ "TRUNCATE TABLE #{ table_names . map ( &method ( :quote_table_name ) ) . join ( ", " ) } " ]
439
449
end
440
450
441
451
def all_schemas
0 commit comments