빠른 시작

5분 안에 DBX를 시작해보세요!

설치

pip install dbx-py

첫 번째 프로그램

from dbx_py import Database

# 인메모리 데이터베이스 열기
db = Database.open_in_memory()

# KV 작업
db.insert("users", b"user:1", b"Alice")
value = db.get("users", b"user:1")
print(value.decode())  # Alice

# SQL 작업
db.execute_sql("CREATE TABLE users (id INTEGER, name TEXT)")
db.execute_sql("INSERT INTO users VALUES (1, 'Alice')")
result = db.execute_sql("SELECT * FROM users")
print(result)

db.close()

Context Manager 사용

with Database("mydb.db") as db:
    db.insert("users", b"user:1", b"Alice")
    # 자동으로 flush() 및 close()

다음 단계


Copyright © 2026 ByteLogicCore. MIT OR Apache-2.0 License.

This site uses Just the Docs, a documentation theme for Jekyll.