Compare commits
2 Commits
9e6397f038
...
491a1a3a4f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
491a1a3a4f | ||
|
|
da3aad8713 |
@@ -1,7 +1,7 @@
|
||||
export async function onRequest(context) {
|
||||
console.log(context);
|
||||
if (context.params.dump !== context.env.DUMP_KEY) {
|
||||
return new Response();
|
||||
return new Response("Wrong key");
|
||||
}
|
||||
const db = context.env.D1DB;
|
||||
const dump = await db.dump();
|
||||
|
||||
16
migrate.py
Normal file
16
migrate.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import anydbm
|
||||
import sqlite3
|
||||
|
||||
data = anydbm.open("cryptopad.db", 'c');
|
||||
|
||||
con = sqlite3.connect("my.db")
|
||||
con.text_factory = str
|
||||
con.execute("CREATE TABLE data (k BLOB, v BLOB, PRIMARY KEY (`k`))")
|
||||
|
||||
cur = con.cursor()
|
||||
|
||||
for k,v in data.iteritems():
|
||||
print k
|
||||
cur.execute("INSERT INTO data VALUES (?,?)", [k,v])
|
||||
|
||||
con.commit()
|
||||
Reference in New Issue
Block a user