Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/?q=database&page=339&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=database

Returns an array of strings in format "username" or "username/projectName"

Found 3476 results for "database"(526ms)

sqliteExplorerAppREADME.md1 match

@nbbaier•Updated 1 year ago
30- [ ] add triggers to sidebar
31- [ ] add upload from SQL, CSV and JSON
32- [ ] add ability to connect to a non-val town Turso database
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable

sqliteDumpREADME.md1 match

@nbbaier•Updated 1 year ago
1# SQLite Dump Util
2
3A utility function that generates SQL statements to dump the data and schema of tables in a SQLite database.
4
5## Usage

BlobArrayREADME.md1 match

@joey•Updated 1 year ago
1### Blob Array
2
3Create an array as a Database, instantly!
4
5Just create a new val for your array:

ValTupleStoragemain.tsx1 match

@chet•Updated 1 year ago
2
3import { jsonCodec } from "npm:lexicodec";
4import { KeyValuePair, ScanStorageArgs, Tuple, WriteOps } from "npm:tuple-database";
5
6export class ValTupleStorage {

ValTupleStorage_ExampleREADME.md1 match

@chet•Updated 1 year ago
1Migrated from folder: Database/ValTupleStorage_Example

ValTupleStorageREADME.md1 match

@chet•Updated 1 year ago
1Migrated from folder: Database/ValTupleStorage

sqliteWriterREADME.md3 matches

@nbbaier•Updated 1 year ago
1# SQLite QueryWriter
2
3The QueryWriter class is a utility for generating and executing SQL queries using natural language and OpenAI. It provides a simplified interface for interacting with your Val Town SQLite database and generating SQL queries based on user inputs.
4
5This val is inspired by [prisma-gpt](https://github.com/aliyeysides/prisma-gpt). PRs welcome! See **Todos** below for some ideas I have.
42Creates a new instance of the QueryWriter class.
43
44- `table`: The name of the database table to operate on.
45- `model` (optional): The model to use for generating SQL queries. Defaults to "gpt-3.5-turbo".
46- `apiKey` (optional): An OpenAI API key. Defaults to `Deno.env.get("OPENAI_API_KEY")`.
68- [ ] Edit prompt to allow for more than just `SELECT` queries
69- [ ] Allow a user to add to the system prompt maybe?
70- [ ] Expand usage beyond just Turso SQLite to integrate with other databases
71
72Migrated from folder: projects/gptTools/sqliteWriter

add_to_notion_w_ai_webpagemain.tsx19 matches

@nerdymomocat•Updated 1 year ago
41function createPrompt(title, description, properties) {
42 let prompt =
43 "You are processing content into a database. Based on the title of the database, its properties, their types and options, and any existing descriptions, infer appropriate values for the fields:\n";
44 prompt += `Database Title: ${title}\n`;
45
46 if (description) {
47 prompt += `Database Description: ${description}\n\n`;
48 } else {
49 prompt += "\n";
115}
116
117async function get_and_save_notion_db_processed_properties(databaseId)
118{
119 const response = await notion.databases.retrieve({ database_id: databaseId });
120 const db_id = response.id.replaceAll("-", "");
121 const processed_properties = processProperties(response);
126}
127
128async function get_notion_db_info(databaseId) {
129 databaseId = databaseId.replaceAll("-", "");
130 let db_info = null;
131 try {
132 db_info = await blob.getJSON(databaseId);
133 if (!db_info) {
134 throw new Error("db_info is null or undefined");
135 }
136 } catch (error) {
137 db_info = await get_and_save_notion_db_processed_properties(databaseId);
138 }
139 console.log(db_info);
142}
143
144async function get_and_save_notion_db_info(databaseId) {
145 databaseId = databaseId.replaceAll("-", "");
146 let db_info = await get_and_save_notion_db_processed_properties(databaseId);
147 db_info["zod_schema"] = createZodSchema(db_info["filteredProps"]);
148 return db_info;
288}
289
290async function addToNotion(databaseId, text) {
291 databaseId = databaseId.replaceAll("-", "");
292 const properties = await process_text(databaseId, text);
293 console.log(properties);
294 const response = await notion.pages.create({
295 "parent": {
296 "type": "database_id",
297 "database_id": databaseId,
298 },
299 "properties": properties,
316 <div id="answer">
317 <div id="answer-content" hx-get="/clear" hx-trigger="load delay:2s" hx-target="#answer">
318 Processed and added to Notion Database
319 </div>
320 </div>
329 <html>
330 <head>
331 <title>Add To Money Database W/ AI</title>
332 <style>
333 {`

add_to_notion_w_ai_webpageREADME.md1 match

@nerdymomocat•Updated 1 year ago
1Example usage of the [add_to_notion_w_ai val](https://www.val.town/v/nerdymomocat/add_to_notion_w_ai)
2
3Try with the [money database](https://nerdymomocat-shortened-url.vercel.app/ai-add-to-money-db).
4
5Read and watch the demo run [here](https://nerdymomocat.github.io/posts/use-notions-property-description-as-text-db-add-itor/)

add_to_notion_w_aimain.tsx17 matches

@nerdymomocat•Updated 1 year ago
37function createPrompt(title, description, properties) {
38 let prompt =
39 "You are processing content into a database. Based on the title of the database, its properties, their types and options, and any existing descriptions, infer appropriate values for the fields:\n";
40 prompt += `Database Title: ${title}\n`;
41
42 if (description) {
43 prompt += `Database Description: ${description}\n\n`;
44 } else {
45 prompt += "\n";
111}
112
113async function get_and_save_notion_db_processed_properties(databaseId)
114{
115 const response = await notion.databases.retrieve({ database_id: databaseId });
116 const db_id = response.id.replaceAll("-", "");
117 const processed_properties = processProperties(response);
122}
123
124async function get_notion_db_info(databaseId) {
125 databaseId = databaseId.replaceAll("-", "");
126 let db_info = null;
127 try {
128 db_info = await blob.getJSON(databaseId);
129 if (!db_info) {
130 throw new Error("db_info is null or undefined");
131 }
132 } catch (error) {
133 db_info = await get_and_save_notion_db_processed_properties(databaseId);
134 }
135 db_info["zod_schema"] = createZodSchema(db_info["filteredProps"]);
137}
138
139async function get_and_save_notion_db_info(databaseId) {
140 databaseId = databaseId.replaceAll("-", "");
141 let db_info = await get_and_save_notion_db_processed_properties(databaseId);
142 db_info["zod_schema"] = createZodSchema(db_info["filteredProps"]);
143 return db_info;
283}
284
285async function addToNotion(databaseId, text) {
286 databaseId = databaseId.replaceAll("-", "");
287 const properties = await process_text(databaseId, text);
288 console.log(properties);
289 const response = await notion.pages.create({
290 "parent": {
291 "type": "database_id",
292 "database_id": databaseId,
293 },
294 "properties": properties,

bookmarksDatabase

@s3thi•Updated 2 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 5 months ago