Baptistabomb
Baptistabomb
Explore posts from servers
CDCloudflare Developers
Created by Baptistabomb on 4/12/2024 in #pages-help
how to forward telemetry and functions logs to axiom?
how can I forward the logs?
1 replies
DTDrizzle Team
Created by Baptistabomb on 4/10/2024 in #help
How to migrate this betterSqlite3 query to drizzle
export const search = async (
text: string,
{ filterId }: { filterId?: string } = {},
) => {
if (!text) return [];

const vector = await getEmbedding(text);
const searchQuery = db.prepare(`
WITH matching_products AS (
SELECT rowid, distance
FROM products_vss
WHERE vss_search(vector, ?)
${filterId ? 'AND rowid != ?' : ''}
AND distance < 1.5
ORDER BY distance ASC
LIMIT 5
)
SELECT p.*, mp.distance
FROM products p
INNER JOIN matching_products mp ON p.id = mp.rowid;
`);

return searchQuery.all(JSON.stringify(vector), filterId) as Product[];
};
export const search = async (
text: string,
{ filterId }: { filterId?: string } = {},
) => {
if (!text) return [];

const vector = await getEmbedding(text);
const searchQuery = db.prepare(`
WITH matching_products AS (
SELECT rowid, distance
FROM products_vss
WHERE vss_search(vector, ?)
${filterId ? 'AND rowid != ?' : ''}
AND distance < 1.5
ORDER BY distance ASC
LIMIT 5
)
SELECT p.*, mp.distance
FROM products p
INNER JOIN matching_products mp ON p.id = mp.rowid;
`);

return searchQuery.all(JSON.stringify(vector), filterId) as Product[];
};
1 replies
CDCloudflare Developers
Created by Baptistabomb on 3/16/2024 in #general-help
Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size lim
How can I know which one is too big?
19 replies
CDCloudflare Developers
Created by Baptistabomb on 3/7/2024 in #general-help
How to optimize images
Hi, I have a nextjs app on cloudflare pages but I just saw Image optimization is not supported, my images are in the public folder how can I optimize them without subscribing to a paid plan for now?
2 replies