A simple package that allows you to connect with Cloudflare D1 and run queries.
import { d1 } from "@abku/d1";
const d1 = new d1(account_id, token, database_id);
async main(){
const response = await d1.listDatabase();
console.log(response)
}
main()
d1.query('SQL QUERY HERE');
d1.createDatabase('database-name');
d1.deleteDatabase('database-id');
d1.getDatabase('database-id');
d1.listDatabase();
Please make sure you setup token. docs.
Need Help? Join discord server.