Skip to content

Commit

Permalink
chore: remove import statments from JSDocs examples
Browse files Browse the repository at this point in the history
  • Loading branch information
bombillazo committed Feb 6, 2024
1 parent 43fc648 commit 1fd283c
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 82 deletions.
28 changes: 0 additions & 28 deletions client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ export abstract class QueryClient {
* In order to create a transaction, use the `createTransaction` method in your client as follows:
*
* ```ts
* import { Client } from "./client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("my_transaction_name");
*
Expand All @@ -119,8 +117,6 @@ export abstract class QueryClient {
* the client without applying any of the changes that took place inside it
*
* ```ts
* import { Client } from "./client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
*
Expand All @@ -137,7 +133,6 @@ export abstract class QueryClient {
* the transaction
*
* ```ts
* import { Client } from "./client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
Expand All @@ -163,17 +158,13 @@ export abstract class QueryClient {
* - Repeatable read: This isolates the transaction in a way that any external changes to the data we are reading
* won't be visible inside the transaction until it has finished
* ```ts
* import { Client } from "./client.ts";
*
* const client = new Client();
* const transaction = await client.createTransaction("my_transaction", { isolation_level: "repeatable_read" });
* ```
*
* - Serializable: This isolation level prevents the current transaction from making persistent changes
* if the data they were reading at the beginning of the transaction has been modified (recommended)
* ```ts
* import { Client } from "./client.ts";
*
* const client = new Client();
* const transaction = await client.createTransaction("my_transaction", { isolation_level: "serializable" });
* ```
Expand All @@ -186,8 +177,6 @@ export abstract class QueryClient {
* is to in conjuction with the repeatable read isolation, ensuring the data you are reading does not change
* during the transaction, specially useful for data extraction
* ```ts
* import { Client } from "./client.ts";
*
* const client = new Client();
* const transaction = await client.createTransaction("my_transaction", { read_only: true });
* ```
Expand All @@ -198,8 +187,6 @@ export abstract class QueryClient {
* you can do the following:
*
* ```ts
* import { Client } from "./client.ts";
*
* const client_1 = new Client();
* const client_2 = new Client();
* const transaction_1 = client_1.createTransaction("transaction_1");
Expand Down Expand Up @@ -267,8 +254,6 @@ export abstract class QueryClient {
* Execute queries and retrieve the data as array entries. It supports a generic in order to type the entries retrieved by the query
*
* ```ts
* import { Client } from "./client.ts";
*
* const my_client = new Client();
*
* const {rows} = await my_client.queryArray(
Expand All @@ -289,8 +274,6 @@ export abstract class QueryClient {
* Use the configuration object for more advance options to execute the query
*
* ```ts
* import { Client } from "./client.ts";
*
* const my_client = new Client();
* const { rows } = await my_client.queryArray<[number, string]>({
* text: "SELECT ID, NAME FROM CLIENTS",
Expand All @@ -305,7 +288,6 @@ export abstract class QueryClient {
* Execute prepared statements with template strings
*
* ```ts
* import { Client } from "./client.ts";
* const my_client = new Client();
*
* const id = 12;
Expand Down Expand Up @@ -353,8 +335,6 @@ export abstract class QueryClient {
* Executed queries and retrieve the data as object entries. It supports a generic in order to type the entries retrieved by the query
*
* ```ts
* import { Client } from "./client.ts";
*
* const my_client = new Client();
*
* const { rows } = await my_client.queryObject(
Expand All @@ -374,8 +354,6 @@ export abstract class QueryClient {
* Use the configuration object for more advance options to execute the query
*
* ```ts
* import { Client } from "./client.ts";
*
* const my_client = new Client();
*
* const {rows} = await my_client.queryObject(
Expand All @@ -397,8 +375,6 @@ export abstract class QueryClient {
* Execute prepared statements with template strings
*
* ```ts
* import { Client } from "./client.ts";
*
* const my_client = new Client();
* const id = 12;
* // Array<{id: number, name: string}>
Expand Down Expand Up @@ -460,8 +436,6 @@ export abstract class QueryClient {
* statements asynchronously
*
* ```ts
* import { Client } from "./client.ts";
*
* const client = new Client();
* await client.connect();
* await client.queryArray`UPDATE MY_TABLE SET MY_FIELD = 0`;
Expand All @@ -472,8 +446,6 @@ export abstract class QueryClient {
* for concurrency capabilities check out connection pools
*
* ```ts
* import { Client } from "./client.ts";
*
* const client_1 = new Client();
* await client_1.connect();
* // Even if operations are not awaited, they will be executed in the order they were
Expand Down
10 changes: 0 additions & 10 deletions pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import { DeferredAccessStack } from "./utils/deferred.ts";
* with their PostgreSQL database
*
* ```ts
* import { Pool } from "./pool.ts";
*
* const pool = new Pool({
* database: "database",
* hostname: "hostname",
Expand All @@ -35,8 +33,6 @@ import { DeferredAccessStack } from "./utils/deferred.ts";
* available connections in the pool
*
* ```ts
* import { Pool } from "./pool.ts";
*
* // Creates a pool with 10 max available connections
* // Connection with the database won't be established until the user requires it
* const pool = new Pool({}, 10, true);
Expand Down Expand Up @@ -119,8 +115,6 @@ export class Pool {
* with the database if no other connections are available
*
* ```ts
* import { Pool } from "./pool.ts";
*
* const pool = new Pool({}, 10);
* const client = await pool.connect();
* await client.queryArray`UPDATE MY_TABLE SET X = 1`;
Expand All @@ -141,8 +135,6 @@ export class Pool {
* This will close all open connections and set a terminated status in the pool
*
* ```ts
* import { Pool } from "./pool.ts";
*
* const pool = new Pool({}, 10);
*
* await pool.end();
Expand All @@ -154,8 +146,6 @@ export class Pool {
* will reinitialize the connections according to the original configuration of the pool
*
* ```ts
* import { Pool } from "./pool.ts";
*
* const pool = new Pool({}, 10);
* await pool.end();
* const client = await pool.connect();
Expand Down
2 changes: 0 additions & 2 deletions query/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import { type Notice } from "../connection/message.ts";
* They will take the position according to the order in which they were provided
*
* ```ts
* import { Client } from "../client.ts";
*
* const my_client = new Client();
*
* await my_client.queryArray("SELECT ID, NAME FROM PEOPLE WHERE AGE > $1 AND AGE < $2", [
Expand Down
42 changes: 0 additions & 42 deletions query/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ export class Savepoint {
* Releasing a savepoint will remove it's last instance in the transaction
*
* ```ts
* import { Client } from "../client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
*
Expand All @@ -73,8 +71,6 @@ export class Savepoint {
* It will also allow you to set the savepoint to the position it had before the last update
*
* ```ts
* import { Client } from "../client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
*
Expand All @@ -99,8 +95,6 @@ export class Savepoint {
* Updating a savepoint will update its position in the transaction execution
*
* ```ts
* import { Client } from "../client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
*
Expand All @@ -114,8 +108,6 @@ export class Savepoint {
* You can also undo a savepoint update by using the `release` method
*
* ```ts
* import { Client } from "../client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
*
Expand Down Expand Up @@ -201,8 +193,6 @@ export class Transaction {
* The begin method will officially begin the transaction, and it must be called before
* any query or transaction operation is executed in order to lock the session
* ```ts
* import { Client } from "../client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction_name");
*
Expand Down Expand Up @@ -278,8 +268,6 @@ export class Transaction {
* current transaction and end the current transaction
*
* ```ts
* import { Client } from "../client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
*
Expand All @@ -292,8 +280,6 @@ export class Transaction {
* start a new with the same transaction parameters in a single statement
*
* ```ts
* import { Client } from "../client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
*
Expand Down Expand Up @@ -353,8 +339,6 @@ export class Transaction {
* the snapshot state between two transactions
*
* ```ts
* import { Client } from "../client.ts";
*
* const client_1 = new Client();
* const client_2 = new Client();
* const transaction_1 = client_1.createTransaction("transaction");
Expand All @@ -379,8 +363,6 @@ export class Transaction {
* It supports a generic interface in order to type the entries retrieved by the query
*
* ```ts
* import { Client } from "../client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
*
Expand All @@ -391,8 +373,6 @@ export class Transaction {
*
* You can pass type arguments to the query in order to hint TypeScript what the return value will be
* ```ts
* import { Client } from "../client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
*
Expand All @@ -404,8 +384,6 @@ export class Transaction {
* It also allows you to execute prepared stamements with template strings
*
* ```ts
* import { Client } from "../client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
*
Expand All @@ -422,7 +400,6 @@ export class Transaction {
* Use the configuration object for more advance options to execute the query
*
* ```ts
* import { Client } from "./client.ts";
*
* const my_client = new Client();
* const { rows } = await my_client.queryArray<[number, string]>({
Expand All @@ -438,7 +415,6 @@ export class Transaction {
* Execute prepared statements with template strings
*
* ```ts
* import { Client } from "./client.ts";
* const my_client = new Client();
*
* const id = 12;
Expand Down Expand Up @@ -489,8 +465,6 @@ export class Transaction {
* Executed queries and retrieve the data as object entries. It supports a generic in order to type the entries retrieved by the query
*
* ```ts
* import { Client } from "./client.ts";
*
* const my_client = new Client();
*
* const { rows } = await my_client.queryObject(
Expand All @@ -510,8 +484,6 @@ export class Transaction {
* Use the configuration object for more advance options to execute the query
*
* ```ts
* import { Client } from "./client.ts";
*
* const my_client = new Client();
*
* const {rows} = await my_client.queryObject(
Expand All @@ -533,8 +505,6 @@ export class Transaction {
* Execute prepared statements with template strings
*
* ```ts
* import { Client } from "./client.ts";
*
* const my_client = new Client();
* const id = 12;
* // Array<{id: number, name: string}>
Expand Down Expand Up @@ -593,8 +563,6 @@ export class Transaction {
* Calling a rollback without arguments will terminate the current transaction and undo all changes.
*
* ```ts
* import { Client } from "../client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
*
Expand All @@ -609,8 +577,6 @@ export class Transaction {
* Savepoints can be used to rollback specific changes part of a transaction.
*
* ```ts
* import { Client } from "../client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
*
Expand All @@ -633,8 +599,6 @@ export class Transaction {
* The `chain` option allows you to undo the current transaction and restart it with the same parameters in a single statement
*
* ```ts
* import { Client } from "../client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
*
Expand Down Expand Up @@ -743,8 +707,6 @@ export class Transaction {
*
* A savepoint can be easily created like this
* ```ts
* import { Client } from "../client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
*
Expand All @@ -755,8 +717,6 @@ export class Transaction {
* All savepoints can have multiple positions in a transaction, and you can change or update
* this positions by using the `update` and `release` methods
* ```ts
* import { Client } from "../client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
*
Expand All @@ -773,8 +733,6 @@ export class Transaction {
* Creating a new savepoint with an already used name will return you a reference to
* the original savepoint
* ```ts
* import { Client } from "../client.ts";
*
* const client = new Client();
* const transaction = client.createTransaction("transaction");
*
Expand Down

0 comments on commit 1fd283c

Please sign in to comment.