Update modules/cfd1.py
All checks were successful
/ check (push) Successful in 16s

This commit is contained in:
Nova Cat 2025-01-25 18:46:24 -08:00
parent 69887c4a02
commit 1c619acfe1

View file

@ -1,13 +1,15 @@
import os
import os, traceback
from cryptography.fernet import Fernet
from cloudflare import Cloudflare
__ircat_type__ = "sql.provider" # The type of module
__ircat_requires__ = ["cf_accountid", "cf_apitoken", "cf_d1database"] # The required config.yml entries.
__ircat_requires__ = ["cf_accountid", "cf_apitoken", "cf_d1database", "fernet-key"] # The required config.yml entries.
class broker:
def __init__(self, cf_accountid:str, cf_apitoken:str, cf_d1database:str):
self.account_id = cf_accountid
self.api_token = cf_apitoken
self.database = cf_d1database
self.client = Cloudflare(api_token=cf_apitoken)
self.fnet = Fernet(fernet_key)
self.client.d1.database.query(
database_id=self.database,
account_id=self.account_id,