Skip to main content
Module

x/dso/mod.ts>Client

Simple Orm library for Deno based on deno_mysql
Latest
class Client
import { Client } from "https://deno.land/x/dso@v1.0.0/mod.ts";

MySQL client

Properties

private
_connections: Connection[]
private
optional
_pool: DeferredStack<Connection>
config: ClientConfig
readonly
pool

get pool info

Methods

private
createConnection(): Promise<Connection>

close connection

connect(config: ClientConfig): Promise<Client>

connect to database

execute(sql: string, params?: any[]): Promise<ExecuteResult>

excute sql

query(sql: string, params?: any[]): Promise<any>

excute query sql

transaction<T = any>(processor: TransactionProcessor<T>): Promise<T>

Execute a transaction process, and the transaction successfully returns the return value of the transaction process

useConnection<T>(fn: (conn: Connection) => Promise<T>)