You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/?q=database&page=1&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 7335 results for "database"(1979ms)
6const PRICE_MULTIPLIER = 1.5;
78// Eventually we'll have a user database,
9// but in the meantime, we can cache user info in memory
10const userIdCache: { [key: string]: any } = {};
37}
3839async initializeDatabase(): Promise<void> {
40// Create tokens table if it doesn't exist
41await sqlite.execute(`
63async storeTokens(userId: string, tokenData: TokenData): Promise<boolean> {
64try {
65await this.initializeDatabase();
6667// Calculate expiration time (default to 1 hour if not provided)
89async getTokens(userId: string): Promise<StoredTokens | null> {
90try {
91await this.initializeDatabase();
9293const result = await sqlite.execute(
133async deleteTokens(userId: string): Promise<boolean> {
134try {
135await this.initializeDatabase();
136137await sqlite.execute(
150async listUsers(): Promise<UserRecord[]> {
151try {
152await this.initializeDatabase();
153154const result = await sqlite.execute(
169async getTokenCount(): Promise<number> {
170try {
171await this.initializeDatabase();
172173const result = await sqlite.execute("SELECT COUNT(*) as count FROM tokens");