Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: JSR support #445

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![Build Status](https://img.shields.io/github/workflow/status/denodrivers/postgres/ci?label=Build&logo=github&style=flat-square)
[![Discord server](https://img.shields.io/discord/768918486575480863?color=blue&label=Ask%20for%20help%20here&logo=discord&style=flat-square)](https://discord.gg/HEdTCvZUSf)
[![Manual](https://img.shields.io/github/v/release/denodrivers/postgres?color=orange&label=Manual&logo=deno&style=flat-square)](https://deno-postgres.com)
[![Documentation](https://img.shields.io/github/v/release/denodrivers/postgres?color=yellow&label=Documentation&logo=deno&style=flat-square)](https://doc.deno.land/https/deno.land/x/[email protected]/mod.ts)
[![Documentation](https://img.shields.io/github/v/release/denodrivers/postgres?color=yellow&label=Documentation&logo=deno&style=flat-square)](https://jsr.io/@bartlomieju/postgres)
[![License](https://img.shields.io/github/license/denodrivers/postgres?color=yellowgreen&label=License&style=flat-square)](LICENSE)

A lightweight PostgreSQL driver for Deno focused on user experience
Expand Down
2 changes: 1 addition & 1 deletion client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export abstract class QueryClient {
this.#connection = connection;
}

get connected() {
get connected(): boolean {
return this.#connection.connected;
}

Expand Down
6 changes: 3 additions & 3 deletions connection/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,17 @@ export class Connection {
#tls?: boolean;
#transport?: "tcp" | "socket";

get pid() {
get pid(): number | undefined {
return this.#pid;
}

/** Indicates if the connection is carried over TLS */
get tls() {
get tls(): boolean | undefined {
return this.#tls;
}

/** Indicates the connection protocol used */
get transport() {
get transport(): "tcp" | "socket" | undefined {
return this.#transport;
}

Expand Down
5 changes: 5 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "@bartlomieju/postgres",
"version": "0.17.1",
"exports": "./mod.ts"
}
20 changes: 10 additions & 10 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export * as base64 from "https://deno.land/std@0.214.0/encoding/base64.ts";
export * as hex from "https://deno.land/std@0.214.0/encoding/hex.ts";
export { parse as parseDate } from "https://deno.land/std@0.214.0/datetime/parse.ts";
export { BufReader } from "https://deno.land/std@0.214.0/io/buf_reader.ts";
export { BufWriter } from "https://deno.land/std@0.214.0/io/buf_writer.ts";
export { copy } from "https://deno.land/std@0.214.0/bytes/copy.ts";
export { crypto } from "https://deno.land/std@0.214.0/crypto/crypto.ts";
export { delay } from "https://deno.land/std@0.214.0/async/delay.ts";
export { bold, yellow } from "https://deno.land/std@0.214.0/fmt/colors.ts";
export * as base64 from "jsr:@std/encoding@0.213.1/base64";
export * as hex from "jsr:@std/encoding@0.213.1/hex";
export { parse as parseDate } from "jsr:@std/datetime@0.213.1/parse";
export { BufReader } from "jsr:@std/io@0.213.1/buf_reader";
export { BufWriter } from "jsr:@std/io@0.213.1/buf_writer";
export { copy } from "jsr:@std/bytes@0.213.1/copy";
export { crypto } from "jsr:@std/crypto@0.213.1/crypto";
export { delay } from "jsr:@std/async@0.213.1/delay";
export { bold, yellow } from "jsr:@std/fmt@0.213.1/colors";
export {
fromFileUrl,
isAbsolute,
join as joinPath,
} from "https://deno.land/std@0.214.0/path/mod.ts";
} from "jsr:@std/path@0.213.1";
2 changes: 1 addition & 1 deletion query/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class QueryResult {
#row_description?: RowDescription;
public warnings: Notice[] = [];

get rowDescription() {
get rowDescription(): RowDescription | undefined {
return this.#row_description;
}

Expand Down
6 changes: 3 additions & 3 deletions query/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class Savepoint {
this.#update_callback = update_callback;
}

get instances() {
get instances(): number {
return this.#instance_count;
}

Expand Down Expand Up @@ -142,11 +142,11 @@ export class Transaction {
this.#updateClientLock = update_client_lock_callback;
}

get isolation_level() {
get isolation_level(): IsolationLevel {
return this.#isolation_level;
}

get savepoints() {
get savepoints(): Savepoint[] {
return this.#savepoints;
}

Expand Down
6 changes: 3 additions & 3 deletions tests/test_deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export {
assertObjectMatch,
assertRejects,
assertThrows,
} from "https://deno.land/std@0.214.0/assert/mod.ts";
export { format as formatDate } from "https://deno.land/std@0.214.0/datetime/format.ts";
export { copy as copyStream } from "https://deno.land/std@0.214.0/io/copy.ts";
} from "jsr:@std/assert@0.213.1";
export { format as formatDate } from "jsr:@std/datetime@0.213.1/format";
export { copy as copyStream } from "jsr:@std/io@0.213.1/copy";
Loading