sqliteExplorerAppREADME.md1 match
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
1This val implements a simple key/value database with GitHub, in a CRUD way.
23The key is a file path within a repository. The value is the file content.
add_to_notion_w_aiREADME.md4 matches
1Uses instructor and open ai (with gpt-4-turbo) to process any content into a notion database entry.
23Use `addToNotion` with any database id and content.
45```
10```
1112Prompts are created based on your database name, database description, property name, property type, property description, and if applicable, property options (and their descriptions).
1314Supports: checkbox, date, multi_select, number, rich_text, select, status, title, url, email
1516- 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
37function createPrompt(title, description, properties) {
38let 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";
40prompt += `Database Title: ${title}\n`;
4142if (description) {
43prompt += `Database Description: ${description}\n\n`;
44} else {
45prompt += "\n";
111}
112113async function get_and_save_notion_db_processed_properties(databaseId)
114{
115const response = await notion.databases.retrieve({ database_id: databaseId });
116const db_id = response.id.replaceAll("-", "");
117const processed_properties = processProperties(response);
122}
123124async function get_notion_db_info(databaseId) {
125databaseId = databaseId.replaceAll("-", "");
126let db_info = null;
127try {
128db_info = await blob.getJSON(databaseId);
129if (!db_info) {
130throw new Error("db_info is null or undefined");
131}
132} catch (error) {
133db_info = await get_and_save_notion_db_processed_properties(databaseId);
134}
135db_info["zod_schema"] = createZodSchema(db_info["filteredProps"]);
137}
138139async function get_and_save_notion_db_info(databaseId) {
140databaseId = databaseId.replaceAll("-", "");
141let db_info = await get_and_save_notion_db_processed_properties(databaseId);
142db_info["zod_schema"] = createZodSchema(db_info["filteredProps"]);
143return db_info;
283}
284285async function addToNotion(databaseId, text) {
286databaseId = databaseId.replaceAll("-", "");
287const properties = await process_text(databaseId, text);
288console.log(properties);
289const response = await notion.pages.create({
290"parent": {
291"type": "database_id",
292"database_id": databaseId,
293},
294"properties": properties,
1import { Database } from "https://esm.sh/duckdb-async";
23export default async function server(request: Request): Promise<Response> {
1011try {
12const db = await Database.create(':memory:');
13await db.all('LOAD httpfs');
14const result = await db.all(`SELECT * FROM '${dataUrl}' LIMIT 5`);
sqliteAdminDashboardmain.tsx1 match
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
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*/
411private dobby: Dobby;
12private namespace: string;
13private databaseName: string;
14private indexes: { name: string; columns: string[] }[];
15private 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*/
26constructor({
27namespace,
28databaseName,
29indexes = [],
30ftsIndexes = []
31}: {
32namespace: string;
33databaseName: string;
34indexes?: { name: string; columns: string[] }[];
35ftsIndexes?: { name: string; columns: string[] }[];
36}) {
37this.namespace = namespace;
38this.databaseName = databaseName;
39this.indexes = indexes;
40this.ftsIndexes = ftsIndexes;
42// Initialize Dobby with the necessary tables, indexes, and FTS indexes
43this.dobby = new Dobby(
44databaseName,
45[
46{ name: 'id', type: 'INTEGER', primaryKey: true },
60);
6162// Initialize the database and create indexes
63this.initializeDatabase();
64}
6566/**
67* Initializes the database and creates indexes.
68*/
69private async initializeDatabase() {
70await this.dobby.createDatabase();
71// Additional setup if needed
72}
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.
23Migrated from folder: Libraries/eventsy/eventsy
getAllNotionDbRowsREADME.md2 matches
1## Get All Rows of a Database in Notion
23Reference: [Query a Database](https://developers.notion.com/reference/post-database-query)
45How to get an access token: https://developers.notion.com/reference/create-a-token
getAllNotionDbRowsmain.tsx4 matches
1export const getAllNotionDbRows = async (databaseId, notionAccessToken) => {
2if (!databaseId) {
3console.error("No Database ID Provided");
4return null;
5}
12return await axios({
13method: "POST",
14url: `https://api.notion.com/v1/databases/${databaseId}/query`,
15headers: {
16Authorization: `Bearer ${notionAccessToken}`,