mirror of
https://github.com/Hopiu/llm.git
synced 2026-05-02 10:54:46 +00:00
Include conversations table in docs schema, refs #91
This commit is contained in:
parent
2d3ebe7fe1
commit
56016aef59
1 changed files with 11 additions and 4 deletions
|
|
@ -62,7 +62,6 @@ import sqlite_utils
|
|||
import re
|
||||
db = sqlite_utils.Database(memory=True)
|
||||
migrate(db)
|
||||
schema = db["responses"].schema
|
||||
|
||||
def cleanup_sql(sql):
|
||||
first_line = sql.split('(')[0]
|
||||
|
|
@ -70,11 +69,19 @@ def cleanup_sql(sql):
|
|||
columns = [l.strip() for l in inner.split(',')]
|
||||
return first_line + '(\n ' + ',\n '.join(columns) + '\n);'
|
||||
|
||||
cog.out(
|
||||
"```sql\n{}\n```\n".format(cleanup_sql(schema))
|
||||
)
|
||||
cog.out("```sql\n")
|
||||
for table in ("conversations", "responses"):
|
||||
schema = db[table].schema
|
||||
cog.out(format(cleanup_sql(schema)))
|
||||
cog.out("\n")
|
||||
cog.out("```\n")
|
||||
]]] -->
|
||||
```sql
|
||||
CREATE TABLE [conversations] (
|
||||
[id] TEXT PRIMARY KEY,
|
||||
[name] TEXT,
|
||||
[model] TEXT
|
||||
);
|
||||
CREATE TABLE [responses] (
|
||||
[id] TEXT PRIMARY KEY,
|
||||
[model] TEXT,
|
||||
|
|
|
|||
Loading…
Reference in a new issue