Ben Chuanlong Du's Blog

It is never too late to learn.

Insert or Update in SQLite3

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Comments

  1. UPSERT does NOT work with virtual table in SQLite3 currently!

The UPSERT clause (following PostgreSQL syntax) is supported in SQLite 3.24.0+.

:::sql
INSERT INTO players (
    user_name, age
) VALUES (
    'steven', 32
) ON CONFLICT (user_name) DO UPDATE
SET age=excluded.age
;

Calling Rust from Python

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Tools

pyo3

Rust bindings for Python, including tools for creating native Python extension modules. Running and interacting with Python code from a Rust binary is also supported.

maturin

Build and publish …