0
点赞
收藏
分享

微信扫一扫

手写swiper

_刘彦辉 2023-10-30 阅读 51

0x00 背景

做项目需要用到sqlite数据库,这里提供2种方式查询数据。

0x01 命令行读取

yum install sqlite-devel 安装数据库。

访问某个数据库

 查看tables

查询表(这里的sql语法和mysql差不多)

 0x02 python程序读取

import sqlite3
conn = sqlite3.connect('xxx.db')
c = conn.cursor()
c.execute("""select * from history order by seq desc limit 100""")
print(c.fetchall())
c.execute("""select * from config limit 100""")
print(c.fetchall())

 

举报

相关推荐

0 条评论