You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.0 KiB
Python

import sqlite3
# create a connection to the database following the structure of schema.sql
connection = sqlite3.connect('library.db')
with open('schema.sql') as f:
connection.executescript(f.read())
cur = connection.cursor()
cur.execute("INSERT INTO categories (title) VALUES (?)", ('Reading',))
cur.execute("INSERT INTO categories (title) VALUES (?)", ('Note',))
cur.execute("INSERT INTO categories (title) VALUES (?)", ('Question',))
cur.execute("INSERT INTO cards (category_id, content) VALUES (?,?)",
(1, 'Oltre Eboli'))
cur.execute("INSERT INTO cards (category_id, content) VALUES (?,?)",
(1, 'This is not an Atlas'))
cur.execute("INSERT INTO topics (content) VALUES (?)", ('mapping process',))
cur.execute("INSERT INTO topics (content) VALUES (?)", ('Radical Neutrality',))
cur.execute("INSERT INTO topics (content) VALUES (?)", ('Honeycomb documentation',))
cur.execute("INSERT INTO topics (content) VALUES (?)", ('Metabolic Publishing',))
# close conenction
connection.commit()
connection.close()