Logo
Explore Help
Register Sign In
Friendfeng/FC
1
1
Fork 0
You've already forked FC
Code Issues Pull Requests Actions Packages Projects 1 Releases 6 Wiki Activity
FC/FFAICilent/local.py

17 lines
576 B
Python
Raw Normal View History

renamed: FFAI/__pycache__/analyzer.cpython-313.pyc -> FFAICilent/__pycache__/analyzer.cpython-313.pyc renamed: FFAI/__pycache__/catch.cpython-313.pyc -> FFAICilent/__pycache__/catch.cpython-313.pyc renamed: FFAI/__pycache__/crawlers.cpython-313.pyc -> FFAICilent/__pycache__/crawlers.cpython-313.pyc renamed: FFAI/__pycache__/crawlers_core.cpython-313.pyc -> FFAICilent/__pycache__/crawlers_core.cpython-313.pyc renamed: FFAI/analyzer.py -> FFAICilent/analyzer.py renamed: FFAI/catch.py -> FFAICilent/catch.py new file: FFAICilent/cloud.py new file: FFAICilent/config/config.ini new file: FFAICilent/config/configloder.py renamed: FFAI/crawlers.py -> FFAICilent/crawlers.py renamed: FFAI/crawlers_core.py -> FFAICilent/crawlers_core.py new file: FFAICilent/local.py new file: FFAICilent/logger.py renamed: FFAI/main.py -> FFAICilent/main.py new file: FFAICilent/manger.py
2025-06-15 13:29:11 +08:00
import sqlite3
from logger import log
class LocalConnector:
def __init__(self, config):
self.db_path = config['Local']['db_path']
self.max_rows = int(config['Local']['max_rows'])
def execute(self, query):
try:
with sqlite3.connect(self.db_path) as conn:
cursor = conn.cursor()
cursor.execute(query)
return cursor.fetchmany(self.max_rows)
except Exception as e:
log.error(f"Local DB error: {str(e)}")
raise ConnectionError("Local storage unavailable")
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 27ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API