Archived
添加了支持MySQL数据库的测试代码
This commit is contained in:
6 files changed
+601
-215
No files matched your search
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
# -- coding:utf-8 --
|
||||
# @Author: markushammered@gmail.com
|
||||
# @Development Tool: PyCharm
|
||||
# @Create Time: 2022/2/26
|
||||
# @File Name: fetchtable.py
|
||||
|
||||
|
||||
import sqlite3
|
||||
|
||||
conn = sqlite3.connect('../db/data.db')
|
||||
cursor = conn.cursor()
|
||||
cursor.execute('select * from sqlite_master where type="table"')
|
||||
tables = []
|
||||
for i in cursor.fetchall():
|
||||
tables.append(i[1])
|
||||
|
||||
print(tables)
|
||||
Reference in New Issue
Block a user