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/image-url.jpg?q=database&page=204&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 7179 results for "database"(619ms)

notion-2-bluesky

notion-2-blueskynotion.ts7 matches

@nuckyโ€ขUpdated 2 weeks ago
1import type { NotionPost, NotionDatabaseResponse } from './types.ts';
2
3const NOTION_API_BASE = 'https://api.notion.com/v1';
5export class NotionClient {
6 private token: string;
7 private databaseId: string;
8
9 constructor(token: string, databaseId: string) {
10 this.token = token;
11 this.databaseId = databaseId;
12 }
13
53 };
54
55 const response: NotionDatabaseResponse = await this.makeRequest(
56 `/databases/${this.databaseId}/query`,
57 {
58 method: 'POST',
87 }
88
89 private parseNotionPage(page: NotionDatabaseResponse['results'][0]): NotionPost {
90 const props = page.properties;
91
notion-2-bluesky

notion-2-blueskytypes.ts1 match

@nuckyโ€ขUpdated 2 weeks ago
35}
36
37export interface NotionDatabaseResponse {
38 results: Array<{
39 id: string;
notion-2-bluesky

notion-2-blueskydebug-env.ts4 matches

@nuckyโ€ขUpdated 2 weeks ago
4export default async function(req: Request) {
5 const blueskyHandle = Deno.env.get('BLUESKY_HANDLE');
6 const notionDatabaseId = Deno.env.get('NOTION_DATABASE_ID');
7
8 return new Response(JSON.stringify({
13 cleaned: blueskyHandle ? blueskyHandle.replace(/[^\w.-]/g, '') : null
14 },
15 notionDatabaseId: {
16 value: notionDatabaseId,
17 length: notionDatabaseId?.length,
18 }
19 }, null, 2), {
notion-2-bluesky

notion-2-blueskytest.ts19 matches

@nuckyโ€ขUpdated 2 weeks ago
84 try {
85 const notionToken = Deno.env.get('NOTION_TOKEN');
86 const notionDatabaseId = Deno.env.get('NOTION_DATABASE_ID');
87 const blueskyHandle = Deno.env.get('BLUESKY_HANDLE');
88 const blueskyAppPassword = Deno.env.get('BLUESKY_APP_PASSWORD');
90 const missing = [];
91 if (!notionToken) missing.push('NOTION_TOKEN');
92 if (!notionDatabaseId) missing.push('NOTION_DATABASE_ID');
93 if (!blueskyHandle) missing.push('BLUESKY_HANDLE');
94 if (!blueskyAppPassword) missing.push('BLUESKY_APP_PASSWORD');
108 success: true,
109 message: 'All required environment variables are set',
110 details: `Handle: ${cleanHandle}\nDatabase ID: ${notionDatabaseId.substring(0, 8)}...`
111 });
112 }
122 try {
123 const notionToken = Deno.env.get('NOTION_TOKEN');
124 const notionDatabaseId = Deno.env.get('NOTION_DATABASE_ID');
125
126 if (notionToken && notionDatabaseId) {
127 const notion = new NotionClient(notionToken, notionDatabaseId);
128 const posts = await notion.getScheduledPosts();
129
131 name: 'Notion Connection',
132 success: true,
133 message: `Successfully connected to Notion database`,
134 details: `Found ${posts.length} scheduled posts ready to publish`
135 });
140 success: false,
141 message: `Failed to connect to Notion: ${error.message}`,
142 details: 'Check your NOTION_TOKEN and NOTION_DATABASE_ID. Make sure the integration has access to the database.'
143 });
144 }
171 }
172
173 // Test 4: Database Schema Check
174 try {
175 const notionToken = Deno.env.get('NOTION_TOKEN');
176 const notionDatabaseId = Deno.env.get('NOTION_DATABASE_ID');
177
178 if (notionToken && notionDatabaseId) {
179 const response = await fetch(`https://api.notion.com/v1/databases/${notionDatabaseId}`, {
180 headers: {
181 'Authorization': `Bearer ${notionToken}`,
185
186 if (response.ok) {
187 const database = await response.json();
188 const properties = database.properties;
189
190 const requiredFields = ['Title', 'Text', 'Scheduled Date', 'Status', 'URL'];
193 if (missingFields.length > 0) {
194 tests.push({
195 name: 'Database Schema',
196 success: false,
197 message: `Missing required fields: ${missingFields.join(', ')}`,
200 } else {
201 tests.push({
202 name: 'Database Schema',
203 success: true,
204 message: 'All required database fields are present',
205 details: `Fields: ${Object.keys(properties).join(', ')}`
206 });
212 } catch (error) {
213 tests.push({
214 name: 'Database Schema',
215 success: false,
216 message: `Failed to check database schema: ${error.message}`,
217 });
218 }

TownieTODOs.md1 match

@tsuchi_yaโ€ขUpdated 2 weeks ago
9- [ ] make it one click to branch off like old jp townie demos
10- [ ] opentownie as a pr bot
11- [ ] give it the ability to see its own client-side and server-side logs by building a middleware that shoves them into a SQL light database date and then give it a tool to access them
12- [ ] do a browser use or screenshot thing to give it access to its own visual output
13- [ ] Have it default to creating a new branch off main

Towniethink.ts1 match

@tsuchi_yaโ€ขUpdated 2 weeks ago
7export const thinkTool = tool({
8 description:
9 "Use the tool to think about something. It will not obtain new information or change the database, but just append the thought to the log. Use it when complex reasoning or some cache memory is needed.",
10 parameters: z.object({
11 thought: z.string().describe("A thought to think about."),

Towniesystem_prompt.txt2 matches

@tsuchi_yaโ€ขUpdated 2 weeks ago
174```
175โ”œโ”€โ”€ backend/
176โ”‚ โ”œโ”€โ”€ database/
177โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
178โ”‚ โ”‚ โ”œโ”€โ”€ queries.ts # DB query functions
234 ```
235
236### Database Patterns
237- Run migrations on startup or comment out for performance
238- Change table names when modifying schemas rather than altering

Towniesend-message.ts1 match

@tsuchi_yaโ€ขUpdated 2 weeks ago
10 overLimit,
11 startTrackingUsage,
12} from "../database/queries.tsx";
13import { makeChangeValTypeTool, makeFetchTool, makeTextEditorTool } from "../tools/index.ts";
14import fileWithLinesNumbers from "../utils/fileWithLinesNumbers.ts";

Towniequeries.tsx1 match

@tsuchi_yaโ€ขUpdated 2 weeks ago
4import { INFERENCE_CALLS_TABLE, USAGE_TABLE } from "./schema.tsx";
5
6// Eventually we'll have a user database,
7// but in the meantime, we can cache user info in memory
8const userIdCache: { [key: string]: any } = {};

Townie.cursorrules2 matches

@tsuchi_yaโ€ขUpdated 2 weeks ago
198```
199โ”œโ”€โ”€ backend/
200โ”‚ โ”œโ”€โ”€ database/
201โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
202โ”‚ โ”‚ โ”œโ”€โ”€ queries.ts # DB query functions
257 ```
258
259### Database Patterns
260- Run migrations on startup or comment out for performance
261- Change table names when modifying schemas rather than altering

bookmarksDatabase

@s3thiโ€ขUpdated 3 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 6 months ago