Skip to content

Instantly share code, notes, and snippets.

View justuswilhelm's full-sized avatar

Justus Perlwitz justuswilhelm

View GitHub Profile
@johnludwigm
johnludwigm / noneandnull.py
Last active August 29, 2023 10:02
NULL vs None in Sqlite3, Python
dbpath = "/.../test.db"
>>> import sqlite3
>>> #Create the database.
>>> connection = sqlite3.connect(dbpath)
>>> cursor = connection.cursor()
>>> cursor.execute("CREATE TABLE Test (testcolumn TEXT);")
<sqlite3.Cursor object at 0x111952ce0>
>>> cursor.execute("INSERT INTO Test VALUES(NULL);")
<sqlite3.Cursor object at 0x111952ce0>