Skip to content

inline_literal is being squashed by op.bulk_insert() #179

@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by Michael Bayer (@zzzeek)

from alembic.migration import MigrationContext
from alembic.operations import Operations
from sqlalchemy import create_engine, literal_column
from sqlalchemy.sql import table, column
import sqlalchemy as sa

engine = create_engine("mysql://")

ctx = MigrationContext.configure(engine, opts=dict(as_sql=True))
op = Operations(ctx)


test = table('test',
               column('id', sa.Integer),
               column('date', sa.Date)
            )

op.bulk_insert(test, [
                       {'id': 1,
                        'date': op.inline_literal('2014-01-01', type_=sa.String),
                        }
])

it's wrapping the _literal_bindparam inside of another one.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions