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/$%7Bart_info.art.src%7D?q=database&page=361&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 3893 results for "database"(487ms)

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}`,

nationalPeachPeacockmain.tsx4 matches

@apppeak•Updated 7 months ago
3import dayjs from "npm:dayjs";
4
5const DATABASE_ID = "519446a0d3ed47038fffd669b9ece770";
6const notion = new Client({ auth: process.env.NOTION_API_KEY });
7
13
14export default async function(interval: Interval) {
15 const response = await notion.databases.query({
16 database_id: DATABASE_ID,
17 filter: {
18 and: [
40
41 const nextItem = {
42 parent: { database_id: DATABASE_ID },
43 properties: {
44 ...item.properties,

wetGrayQueleamain.tsx4 matches

@apppeak•Updated 7 months ago
3import dayjs from "npm:dayjs";
4
5const DATABASE_ID = "519446a0d3ed47038fffd669b9ece770";
6const notion = new Client({ auth: process.env.NOTION_API_KEY });
7
13
14export default async function(interval: Interval) {
15 const response = await notion.databases.query({
16 database_id: DATABASE_ID,
17 filter: {
18 and: [
40
41 const nextItem = {
42 parent: { database_id: DATABASE_ID },
43 properties: {
44 ...item.properties,

dailyPeachSalmonmain.tsx4 matches

@apppeak•Updated 7 months ago
3import dayjs from "npm:dayjs";
4
5const DATABASE_ID = "519446a0d3ed47038fffd669b9ece770";
6const notion = new Client({ auth: process.env.NOTION_API_KEY });
7
13
14export default async function(interval: Interval) {
15 const response = await notion.databases.query({
16 database_id: DATABASE_ID,
17 filter: {
18 and: [
40
41 const nextItem = {
42 parent: { database_id: DATABASE_ID },
43 properties: {
44 ...item.properties,

bookmarksDatabase

@s3thi•Updated 2 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 5 months ago