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=317&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 3407 results for "database"(2245ms)

luciaValtownSqlitemain.tsx22 matches

@yawnxyz•Updated 8 months ago
6import type {
7 Adapter,
8 DatabaseSession,
9 DatabaseUser,
10 RegisteredDatabaseSessionAttributes,
11 RegisteredDatabaseUserAttributes,
12} from "npm:lucia";
13
23}
24
25interface SessionSchema extends RegisteredDatabaseSessionAttributes {
26 id: string;
27 user_id: string;
29}
30
31interface UserSchema extends RegisteredDatabaseUserAttributes {
32 id: string;
33}
59 public async getSessionAndUser(
60 sessionId: string,
61 ): Promise<[session: DatabaseSession | null, user: DatabaseUser | null]> {
62 const [databaseSession, databaseUser] = await Promise.all([
63 this.getSession(sessionId),
64 this.getUserFromSessionId(sessionId),
65 ]);
66 return [databaseSession, databaseUser];
67 }
68
69 public async getUserSessions(userId: string): Promise<DatabaseSession[]> {
70 const result = await this.controller.getAll<SessionSchema>(
71 `SELECT * FROM ${this.escapedSessionTableName} WHERE user_id = ?`,
72 [userId],
73 );
74 return result.map((val) => transformIntoDatabaseSession(val));
75 }
76
77 public async setSession(databaseSession: DatabaseSession): Promise<void> {
78 const value: SessionSchema = {
79 id: databaseSession.id,
80 user_id: databaseSession.userId,
81 expires_at: Math.floor(databaseSession.expiresAt.getTime() / 1000),
82 ...databaseSession.attributes,
83 };
84 const entries = Object.entries(value).filter(([_, v]) => v !== undefined);
108 }
109
110 private async getSession(sessionId: string): Promise<DatabaseSession | null> {
111 const result = await this.controller.get<SessionSchema>(
112 `SELECT * FROM ${this.escapedSessionTableName} WHERE id = ?`,
114 );
115 if (!result) return null;
116 return transformIntoDatabaseSession(result);
117 }
118
119 private async getUserFromSessionId(sessionId: string): Promise<DatabaseUser | null> {
120 const result = await this.controller.get<UserSchema>(
121 `SELECT ${this.escapedUserTableName}.* FROM ${this.escapedSessionTableName} INNER JOIN ${this.escapedUserTableName} ON ${this.escapedUserTableName}.id = ${this.escapedSessionTableName}.user_id WHERE ${this.escapedSessionTableName}.id = ?`,
123 );
124 if (!result) return null;
125 return transformIntoDatabaseUser(result);
126 }
127}
236}
237
238function transformIntoDatabaseSession(raw: SessionSchema): DatabaseSession {
239 const { id, user_id: userId, expires_at: expiresAtUnix, ...attributes } = raw;
240 return {
246}
247
248function transformIntoDatabaseUser(raw: UserSchema): DatabaseUser {
249 const { id, ...attributes } = raw;
250 return {

lucia_middlewaremain.tsx2 matches

@yawnxyz•Updated 8 months ago
49 interface Register {
50 Lucia: typeof lucia;
51 DatabaseUserAttributes: DatabaseUserAttributes;
52 }
53}
54
55interface DatabaseUserAttributes {
56 github_id: number;
57 username: string;

VALLEREADME.md1 match

@gitgrooves•Updated 8 months ago
1# VALL-E
2
3LLM code generation for vals! Make apps with a frontend, backend, and database.
4
5It's a bit of work to get this running, but it's worth it.

sqliteExplorerAppREADME.md1 match

@jpaulgale•Updated 8 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

lucia_middleware_vanillamain.tsx2 matches

@yawnxyz•Updated 8 months ago
26 interface Register {
27 Lucia: typeof lucia;
28 DatabaseUserAttributes: DatabaseUserAttributes;
29 }
30}
31
32interface DatabaseUserAttributes {
33 username: string;
34}

lucia_demomain.tsx2 matches

@yawnxyz•Updated 8 months ago
26 interface Register {
27 Lucia: typeof lucia;
28 DatabaseUserAttributes: DatabaseUserAttributes;
29 }
30}
31
32interface DatabaseUserAttributes {
33 username: string;
34}

lucia_adapter_basemain.tsx22 matches

@yawnxyz•Updated 8 months ago
1import type {
2 Adapter,
3 DatabaseSession,
4 DatabaseUser,
5 RegisteredDatabaseSessionAttributes,
6 RegisteredDatabaseUserAttributes,
7} from "npm:lucia";
8
34 public async getSessionAndUser(
35 sessionId: string,
36 ): Promise<[session: DatabaseSession | null, user: DatabaseUser | null]> {
37 const [databaseSession, databaseUser] = await Promise.all([
38 this.getSession(sessionId),
39 this.getUserFromSessionId(sessionId),
40 ]);
41 return [databaseSession, databaseUser];
42 }
43
44 public async getUserSessions(userId: string): Promise<DatabaseSession[]> {
45 const result = await this.controller.getAll<SessionSchema>(
46 `SELECT * FROM ${this.escapedSessionTableName} WHERE user_id = ?`,
48 );
49 return result.map((val) => {
50 return transformIntoDatabaseSession(val);
51 });
52 }
53
54 public async setSession(databaseSession: DatabaseSession): Promise<void> {
55 const value: SessionSchema = {
56 id: databaseSession.id,
57 user_id: databaseSession.userId,
58 expires_at: Math.floor(databaseSession.expiresAt.getTime() / 1000),
59 ...databaseSession.attributes,
60 };
61 const entries = Object.entries(value).filter(([_, v]) => v !== undefined);
87 }
88
89 private async getSession(sessionId: string): Promise<DatabaseSession | null> {
90 const result = await this.controller.get<SessionSchema>(
91 `SELECT * FROM ${this.escapedSessionTableName} WHERE id = ?`,
93 );
94 if (!result) return null;
95 return transformIntoDatabaseSession(result);
96 }
97
98 private async getUserFromSessionId(sessionId: string): Promise<DatabaseUser | null> {
99 const result = await this.controller.get<UserSchema>(
100 `SELECT ${this.escapedUserTableName}.* FROM ${this.escapedSessionTableName} INNER JOIN ${this.escapedUserTableName} ON ${this.escapedUserTableName}.id = ${this.escapedSessionTableName}.user_id WHERE ${this.escapedSessionTableName}.id = ?`,
102 );
103 if (!result) return null;
104 return transformIntoDatabaseUser(result);
105 }
106}
117}
118
119interface SessionSchema extends RegisteredDatabaseSessionAttributes {
120 id: string;
121 user_id: string;
123}
124
125interface UserSchema extends RegisteredDatabaseUserAttributes {
126 id: string;
127}
128
129function transformIntoDatabaseSession(raw: SessionSchema): DatabaseSession {
130 const { id, user_id: userId, expires_at: expiresAtUnix, ...attributes } = raw;
131 return {
137}
138
139function transformIntoDatabaseUser(raw: UserSchema): DatabaseUser {
140 const { id, ...attributes } = raw;
141 return {

dobbyREADME.md4 matches

@yawnxyz•Updated 8 months ago
5```javascript
6// Example usage:
7const dobby = new Dobby("myDatabase", [
8 { name: "id", type: "INTEGER", primaryKey: true },
9 { name: "name", type: "TEXT", notNull: true },
12]);
13
14await dobby.createDatabase();
15
16// Insert some sample data
47
48
49// Example of using the new dropDatabase function
50await dropDatabase("myDatabase");
51
52```

sqliteExplorerAppREADME.md1 match

@adamwolf•Updated 8 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

textSummarizationComparisonToolmain.tsx1 match

@sharanbabu•Updated 8 months ago
106"Changing the license was a mistake, and Elastic now backtracks from it". We removed a lot of market confusion when we changed our license 3 years ago. And because of our actions, a lot has changed. It's an entirely different landscape now. We aren't living in the past. We want to build a better future for our users. It's because we took action then, that we are in a position to take action now.
107"AGPL is not true open source, license X is": AGPL is an OSI approved license, and it's a widely adopted one. For example, MongoDB used to be AGPL and Grafana is AGPL. It shows that AGPL doesn't affect usage or popularity. We chose AGPL because we believe it's the best way to start to pave a path, with OSI, towards more Open Source in the world, not less.
108"Elastic changes the license because they are not doing well" - I will start by saying that I am as excited today as ever about the future of Elastic. I am tremendously proud of our products and our team's execution. We shipped Stateless Elasticsearch, ES|QL, and tons of vector database/hybrid search improvements for GenAI use cases. We are leaning heavily into OTel in logging and Observability. And our SIEM product in Security keeps adding amazing features and it's one of the fastest growing in the market. Users' response has been humbling. The stock market will have its ups and downs. What I can assure you, is that we are always thinking long term, and this change is part of it.
109If we see more, we will add them above to hopefully reduce confusion.
110

bookmarksDatabase

@s3thi•Updated 2 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 5 months ago