Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python create sqlite db in memory

import sqlite3
from sqlite3 import Error


def create_connection():
    """ create a database connection to a database that resides
        in the memory
    """
    conn = None;
    try:
        conn = sqlite3.connect(':memory:')
        print(sqlite3.version)
    except Error as e:
        print(e)
    finally:
        if conn:
            conn.close()


if __name__ == '__main__':
    create_connection()
Code language: Python (python)
Source by www.sqlitetutorial.net #
 
PREVIOUS NEXT
Tagged: #python #create #sqlite #db #memory
ADD COMMENT
Topic
Name
1+6 =