#21 Javascript and Python Drivers

#21.0 Introduction

how to talk to db with python & JS

#21.1 Inserting Data

import sqlite3

conn = sqlite3.connect("users.db")
cur = conn.cursor()

def init_table():
    cur.execute("""
    CREATE TABLE users(
                user_id integer primary key autoincrement,
                username text not null,
                password text not null
                )
    """)
    
    cur.execute("""
    insert into users (username, userid)
                values ('nico', 123), ('lynn', 321);
    """)
    
init_table()


def print_all_users():
            res = cur.excute("select * from users;")
            data = res.fetchall()
            print(data)

print_all_users()

conn.commit() #transaction commit
conn.close()

#21.2 SQL Injection

#21.3 Placeholders

#21.4 Querying Data

#21.5 MySQL and PostgreSQL Drivers

#21.6 Redis Caching

#21.7 PyMongo

#21.8 Drizzle Introspect

Drizzle - JS || TS 로 사용할 수 있는 ORM

#21.9 Drizzle Migrate

https://orm.drizzle.team/benchmarks

#21.10 Redis

#21.11 Mongoose

Last updated

Was this helpful?