mirror of
https://github.com/langchain-ai/docs.git
synced 2026-08-27 02:41:59 -04:00
17 lines
410 B
Plaintext
17 lines
410 B
Plaintext
```python
|
|
import sqlite3
|
|
|
|
con = sqlite3.connect("Chinook.db")
|
|
cursor = con.cursor()
|
|
|
|
cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
|
|
tables = [row[0] for row in cursor.fetchall() if not row[0].startswith("sqlite_")]
|
|
|
|
print("Dialect: sqlite")
|
|
print(f"Available tables: {tables}")
|
|
|
|
cursor.execute("SELECT * FROM Artist LIMIT 5;")
|
|
print(f"Sample output: {cursor.fetchall()}")
|
|
con.close()
|
|
```
|