Skip to content
Discussion options

You must be logged in to vote

@DKSCIcat No, but you can easily use a transaction for bulk inserts. Something like this.

# using engine instance
async with DB.transaction():
    await Band.insert(
        Band(name="Pythonistas"),
        Band(name="Darts"),
        Band(name="Gophers"),
    )

or

# using thru table meta
async with Band._meta.db.transaction():
    await Band.insert(
        Band(name="Pythonistas"),
        Band(name="Darts"),
        Band(name="Gophers"),
    )

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sinisaos
Comment options

Answer selected by DKSCIcat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants