Skip to content

Commit e6ad9f5

Browse files
committed
chore: remove unused code
1 parent b82e093 commit e6ad9f5

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

postgres.py

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -99,48 +99,3 @@ def get_similar_chunks_with_distance(
9999
)
100100
for r in res
101101
]
102-
103-
104-
def get_random_chunks(limit=5) -> List[Chunk]:
105-
cur = get_connection().cursor()
106-
cur.execute(
107-
"""
108-
SELECT c.id, c.page_id, p.title, p.description, c.text
109-
FROM chunks c
110-
JOIN pages p ON c.page_id = p.id
111-
ORDER BY RANDOM()
112-
LIMIT %s;
113-
""",
114-
(limit,),
115-
)
116-
res = cur.fetchall()
117-
cur.close()
118-
119-
return [
120-
Chunk(id=r[0], pageId=r[1], title=r[2], description=r[3], text=r[4])
121-
for r in res
122-
]
123-
124-
125-
def get_pages(limit=10) -> List[Page]:
126-
cur = get_connection().cursor()
127-
cur.execute(
128-
"SELECT id, title, description, text FROM pages LIMIT %s;",
129-
(limit,),
130-
)
131-
res = cur.fetchall()
132-
cur.close()
133-
134-
return [Page(id=r[0], title=r[1], description=r[2], text=r[3]) for r in res]
135-
136-
137-
def get_random_pages(limit=10) -> List[Page]:
138-
cur = get_connection().cursor()
139-
cur.execute(
140-
"SELECT id, title, description, text FROM pages ORDER BY RANDOM() LIMIT %s;",
141-
(limit,),
142-
)
143-
res = cur.fetchall()
144-
cur.close()
145-
146-
return [Page(id=r[0], title=r[1], description=r[2], text=r[3]) for r in res]

0 commit comments

Comments
 (0)