MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / _process_multiparam_default_bind

Function _process_multiparam_default_bind

lib/sqlalchemy/sql/crud.py:1429–1459  ·  view source on GitHub ↗
(
    compiler: SQLCompiler,
    stmt: ValuesBase,
    c: KeyedColumnElement[Any],
    index: int,
    kw: Dict[str, Any],
)

Source from the content-addressed store, hash-verified

1427
1428
1429def _process_multiparam_default_bind(
1430 compiler: SQLCompiler,
1431 stmt: ValuesBase,
1432 c: KeyedColumnElement[Any],
1433 index: int,
1434 kw: Dict[str, Any],
1435) -> str:
1436 if not c.default:
1437 raise exc.CompileError(
1438 "INSERT value for column %s is explicitly rendered as a bound"
1439 "parameter in the VALUES clause; "
1440 "a Python-side value or SQL expression is required" % c
1441 )
1442 elif default_is_clause_element(c.default):
1443 return compiler.process(c.default.arg.self_group(), **kw)
1444 elif c.default.is_sequence:
1445 # these conditions would have been established
1446 # by append_param_insert_(?:hasdefault|pk_returning|pk_no_returning)
1447 # in order for us to be here, so these don't need to be
1448 # checked
1449 # assert compiler.dialect.supports_sequences and (
1450 # not c.default.optional
1451 # or not compiler.dialect.sequences_optional
1452 # )
1453 return compiler.process(c.default, **kw)
1454 else:
1455 col = _multiparam_column(c, index)
1456 assert isinstance(stmt, dml.Insert)
1457 return _create_insert_prefetch_bind_param(
1458 compiler, col, process=True, **kw
1459 )
1460
1461
1462def _get_update_multitable_params(

Callers 1

Calls 5

_multiparam_columnClass · 0.85
processMethod · 0.45
self_groupMethod · 0.45

Tested by

no test coverage detected