| 32 | } |
| 33 | |
| 34 | class Adapter implements DatabaseAdapter { |
| 35 | constructor(private db: Database.Database) {} |
| 36 | exec(sql: string) { |
| 37 | this.db.exec(sql) |
| 38 | } |
| 39 | prepare(sql: string) { |
| 40 | return new Stmt(this.db.prepare(sql)) |
| 41 | } |
| 42 | transaction<T>(fn: () => T): T { |
| 43 | return this.db.transaction(fn)() |
| 44 | } |
| 45 | pragma(p: string) { |
| 46 | return this.db.pragma(p) |
| 47 | } |
| 48 | close() { |
| 49 | this.db.close() |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | // 2024-01-15 12:00:00 UTC, 时区偏移不会跨出 2024-01 |
| 54 | const TS = 1705320000 |
nothing calls this directly
no outgoing calls
no test coverage detected