optimize db_path memory
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import sqlite3
|
||||
|
||||
db_path = "../src/db_ntfs_info.db"
|
||||
conn = sqlite3.connect(db_path)
|
||||
cursor = conn.cursor()
|
||||
|
||||
|
||||
def GetDeviceId(cursor: sqlite3.Cursor) -> int:
|
||||
cursor.execute("SELECT ID FROM db_device ORDER BY ID LIMIT 1")
|
||||
result = cursor.fetchone()
|
||||
return result[0] if result else 0
|
||||
|
||||
|
||||
print(GetDeviceId(cursor))
|
||||
|
Reference in New Issue
Block a user