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=319&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"(772ms)

sqliteExplorerAppREADME.md1 match

@flymaster•Updated 7 months 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

ghdbREADME.md1 match

@begoon•Updated 7 months ago
1This val implements a simple key/value database with GitHub, in a CRUD way.
2
3The key is a file path within a repository. The value is the file content.

add_to_notion_w_aiREADME.md4 matches

@eyeseethru•Updated 7 months ago
1Uses instructor and open ai (with gpt-4-turbo) to process any content into a notion database entry.
2
3Use `addToNotion` with any database id and content.
4
5```
10```
11
12Prompts are created based on your database name, database description, property name, property type, property description, and if applicable, property options (and their descriptions).
13
14Supports: checkbox, date, multi_select, number, rich_text, select, status, title, url, email
15
16- Uses `NOTION_API_KEY`, `OPENAI_API_KEY` stored in env variables and uses [Valtown blob storage](https://esm.town/v/std/blob) to store information about the database.
17- Use `get_notion_db_info` to use the stored blob if exists or create one, use `get_and_save_notion_db_info` to create a new blob (and replace an existing one if exists).

add_to_notion_w_aimain.tsx17 matches

@eyeseethru•Updated 7 months 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,

duckDBmain.tsx2 matches

@adjacent•Updated 7 months ago
1import { Database } from "https://esm.sh/duckdb-async";
2
3export default async function server(request: Request): Promise<Response> {
10
11 try {
12 const db = await Database.create(':memory:');
13 await db.all('LOAD httpfs');
14 const result = await db.all(`SELECT * FROM '${dataUrl}' LIMIT 5`);

sqliteAdminDashboardmain.tsx1 match

@stevekrouse•Updated 7 months ago
1// This val creates a SQLite dashboard admin panel with a sidebar for table names
2// It uses React for the frontend and the Val Town SQLite API for database operations
3// Now includes functionality to edit rows, using rowid or all columns as identifiers
4// and the ability to add new rows to tables

eventsymain.tsx14 matches

@yawnxyz•Updated 7 months ago
1/**
2 * The Eventsy class represents a system for logging and managing events. It utilizes Dobby for database operations and provides methods for logging events, retrieving events by type, performing full-text searches, and more. This class is designed to be flexible and adaptable to various event logging needs.
3 */
4
11 private dobby: Dobby;
12 private namespace: string;
13 private databaseName: string;
14 private indexes: { name: string; columns: string[] }[];
15 private ftsIndexes: { name: string; columns: string[] }[];
20 * @param {Object} options - The options for initializing the Eventsy instance.
21 * @param {string} options.namespace - The namespace for the events.
22 * @param {string} options.databaseName - The name of the database.
23 * @param {{ name: string; columns: string[] }[]} options.indexes - The indexes for the database.
24 * @param {{ name: string; columns: string[] }[]} options.ftsIndexes - The full-text search indexes for the database.
25 */
26 constructor({
27 namespace,
28 databaseName,
29 indexes = [],
30 ftsIndexes = []
31 }: {
32 namespace: string;
33 databaseName: string;
34 indexes?: { name: string; columns: string[] }[];
35 ftsIndexes?: { name: string; columns: string[] }[];
36 }) {
37 this.namespace = namespace;
38 this.databaseName = databaseName;
39 this.indexes = indexes;
40 this.ftsIndexes = ftsIndexes;
42 // Initialize Dobby with the necessary tables, indexes, and FTS indexes
43 this.dobby = new Dobby(
44 databaseName,
45 [
46 { name: 'id', type: 'INTEGER', primaryKey: true },
60 );
61
62 // Initialize the database and create indexes
63 this.initializeDatabase();
64 }
65
66 /**
67 * Initializes the database and creates indexes.
68 */
69 private async initializeDatabase() {
70 await this.dobby.createDatabase();
71 // Additional setup if needed
72 }

eventsyREADME.md1 match

@yawnxyz•Updated 7 months ago
1The Eventsy class represents a system for logging and managing events. It utilizes Dobby for database operations and provides methods for logging events, retrieving events by type, performing full-text searches, and more. This class is designed to be flexible and adaptable to various event logging needs.
2
3Migrated from folder: Libraries/eventsy/eventsy

getAllNotionDbRowsREADME.md2 matches

@apppeak•Updated 7 months ago
1## Get All Rows of a Database in Notion
2
3Reference: [Query a Database](https://developers.notion.com/reference/post-database-query)
4
5How to get an access token: https://developers.notion.com/reference/create-a-token

getAllNotionDbRowsmain.tsx4 matches

@apppeak•Updated 7 months ago
1export const getAllNotionDbRows = async (databaseId, notionAccessToken) => {
2 if (!databaseId) {
3 console.error("No Database ID Provided");
4 return null;
5 }
12 return await axios({
13 method: "POST",
14 url: `https://api.notion.com/v1/databases/${databaseId}/query`,
15 headers: {
16 Authorization: `Bearer ${notionAccessToken}`,

bookmarksDatabase

@s3thi•Updated 2 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 5 months ago