shithub: riscv

ref: a7c01127f9749fe471367c6461cde357403cc3b3
dir: /sys/src/cmd/python/Doc/lib/sqlite3/executescript.py/

View raw version
import sqlite3

con = sqlite3.connect(":memory:")
cur = con.cursor()
cur.executescript("""
    create table person(
        firstname,
        lastname,
        age
    );

    create table book(
        title,
        author,
        published
    );

    insert into book(title, author, published)
    values (
        'Dirk Gently''s Holistic Detective Agency',
        'Douglas Adams',
        1987
    );
    """)