MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _InsertManyValues

Class _InsertManyValues

lib/sqlalchemy/sql/compiler.py:501–630  ·  view source on GitHub ↗

represents state to use for executing an "insertmanyvalues" statement. The primary consumers of this object are the :meth:`.SQLCompiler._deliver_insertmanyvalues_batches` and :meth:`.DefaultDialect._deliver_insertmanyvalues_batches` methods. .. versionadded:: 2.0

Source from the content-addressed store, hash-verified

499
500
501class _InsertManyValues(NamedTuple):
502 """represents state to use for executing an "insertmanyvalues" statement.
503
504 The primary consumers of this object are the
505 :meth:`.SQLCompiler._deliver_insertmanyvalues_batches` and
506 :meth:`.DefaultDialect._deliver_insertmanyvalues_batches` methods.
507
508 .. versionadded:: 2.0
509
510 """
511
512 is_default_expr: bool
513 """if True, the statement is of the form
514 ``INSERT INTO TABLE DEFAULT VALUES``, and can't be rewritten as a "batch"
515
516 """
517
518 single_values_expr: str
519 """The rendered "values" clause of the INSERT statement.
520
521 This is typically the parenthesized section e.g. "(?, ?, ?)" or similar.
522 The insertmanyvalues logic uses this string as a search and replace
523 target.
524
525 """
526
527 insert_crud_params: List[crud._CrudParamElementStr]
528 """List of Column / bind names etc. used while rewriting the statement"""
529
530 num_positional_params_counted: int
531 """the number of bound parameters in a single-row statement.
532
533 This count may be larger or smaller than the actual number of columns
534 targeted in the INSERT, as it accommodates for SQL expressions
535 in the values list that may have zero or more parameters embedded
536 within them.
537
538 This count is part of what's used to organize rewritten parameter lists
539 when batching.
540
541 """
542
543 sort_by_parameter_order: bool = False
544 """if the deterministic_returnined_order parameter were used on the
545 insert.
546
547 All of the attributes following this will only be used if this is True.
548
549 """
550
551 includes_upsert_behaviors: bool = False
552 """if True, we have to accommodate for upsert behaviors.
553
554 This will in some cases downgrade "insertmanyvalues" that requests
555 deterministic ordering.
556
557 """
558

Callers 1

visit_insertMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected