1 from sqlite3 import connect
3 __all__ = ("initdb", "stow")
7 SCHEMA = """create table if not exists events (
8 timestamp real not null,
10 clntaddr text not null,
23 def stow(clntaddr, timestamp, imei, length, proto, payload):
27 ("clntaddr", "timestamp", "imei", "length", "proto", "payload"),
28 (str(clntaddr), timestamp, imei, length, proto, payload),
32 """insert or ignore into events
33 (timestamp, imei, clntaddr, length, proto, payload)
35 (:timestamp, :imei, :clntaddr, :length, :proto, :payload)