Home / File/ libsql-local.ts — astro Source File

libsql-local.ts — astro Source File

Architecture documentation for libsql-local.ts, a typescript file in the astro codebase. 2 imports, 0 dependents.

File typescript CoreAstro CoreMiddleware 2 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  57db5a52_343c_27f0_e8e2_fa1309bb139d["libsql-local.ts"]
  91decf0f_8a76_7391_4c56_d2f49dbb7487["client"]
  57db5a52_343c_27f0_e8e2_fa1309bb139d --> 91decf0f_8a76_7391_4c56_d2f49dbb7487
  512bd4d0_25e3_774d_1dff_0825d694fa9f["libsql"]
  57db5a52_343c_27f0_e8e2_fa1309bb139d --> 512bd4d0_25e3_774d_1dff_0825d694fa9f
  style 57db5a52_343c_27f0_e8e2_fa1309bb139d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { createClient as createLibsqlClient } from '@libsql/client';
import { drizzle as drizzleLibsql, type LibSQLDatabase } from 'drizzle-orm/libsql';

const isWebContainer = !!process.versions?.webcontainer;

type LocalDbClientOptions = {
	url: string;
};

export function createClient(options: LocalDbClientOptions): LibSQLDatabase {
	const url = isWebContainer ? 'file:content.db' : options.url;
	const client = createLibsqlClient({ url });
	const db = drizzleLibsql(client);
	return db;
}

Domain

Subdomains

Functions

Dependencies

  • client
  • libsql

Frequently Asked Questions

What does libsql-local.ts do?
libsql-local.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, CoreMiddleware subdomain.
What functions are defined in libsql-local.ts?
libsql-local.ts defines 1 function(s): createClient.
What does libsql-local.ts depend on?
libsql-local.ts imports 2 module(s): client, libsql.
Where is libsql-local.ts in the architecture?
libsql-local.ts is located at packages/db/src/core/db-client/libsql-local.ts (domain: CoreAstro, subdomain: CoreMiddleware, directory: packages/db/src/core/db-client).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free