Skip to content

Commit 1fd283c

Browse files
committed
chore: remove import statments from JSDocs examples
1 parent 43fc648 commit 1fd283c

File tree

4 files changed

+0
-82
lines changed

4 files changed

+0
-82
lines changed

client.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ export abstract class QueryClient {
105105
* In order to create a transaction, use the `createTransaction` method in your client as follows:
106106
*
107107
* ```ts
108-
* import { Client } from "./client.ts";
109-
*
110108
* const client = new Client();
111109
* const transaction = client.createTransaction("my_transaction_name");
112110
*
@@ -119,8 +117,6 @@ export abstract class QueryClient {
119117
* the client without applying any of the changes that took place inside it
120118
*
121119
* ```ts
122-
* import { Client } from "./client.ts";
123-
*
124120
* const client = new Client();
125121
* const transaction = client.createTransaction("transaction");
126122
*
@@ -137,7 +133,6 @@ export abstract class QueryClient {
137133
* the transaction
138134
*
139135
* ```ts
140-
* import { Client } from "./client.ts";
141136
*
142137
* const client = new Client();
143138
* const transaction = client.createTransaction("transaction");
@@ -163,17 +158,13 @@ export abstract class QueryClient {
163158
* - Repeatable read: This isolates the transaction in a way that any external changes to the data we are reading
164159
* won't be visible inside the transaction until it has finished
165160
* ```ts
166-
* import { Client } from "./client.ts";
167-
*
168161
* const client = new Client();
169162
* const transaction = await client.createTransaction("my_transaction", { isolation_level: "repeatable_read" });
170163
* ```
171164
*
172165
* - Serializable: This isolation level prevents the current transaction from making persistent changes
173166
* if the data they were reading at the beginning of the transaction has been modified (recommended)
174167
* ```ts
175-
* import { Client } from "./client.ts";
176-
*
177168
* const client = new Client();
178169
* const transaction = await client.createTransaction("my_transaction", { isolation_level: "serializable" });
179170
* ```
@@ -186,8 +177,6 @@ export abstract class QueryClient {
186177
* is to in conjuction with the repeatable read isolation, ensuring the data you are reading does not change
187178
* during the transaction, specially useful for data extraction
188179
* ```ts
189-
* import { Client } from "./client.ts";
190-
*
191180
* const client = new Client();
192181
* const transaction = await client.createTransaction("my_transaction", { read_only: true });
193182
* ```
@@ -198,8 +187,6 @@ export abstract class QueryClient {
198187
* you can do the following:
199188
*
200189
* ```ts
201-
* import { Client } from "./client.ts";
202-
*
203190
* const client_1 = new Client();
204191
* const client_2 = new Client();
205192
* const transaction_1 = client_1.createTransaction("transaction_1");
@@ -267,8 +254,6 @@ export abstract class QueryClient {
267254
* Execute queries and retrieve the data as array entries. It supports a generic in order to type the entries retrieved by the query
268255
*
269256
* ```ts
270-
* import { Client } from "./client.ts";
271-
*
272257
* const my_client = new Client();
273258
*
274259
* const {rows} = await my_client.queryArray(
@@ -289,8 +274,6 @@ export abstract class QueryClient {
289274
* Use the configuration object for more advance options to execute the query
290275
*
291276
* ```ts
292-
* import { Client } from "./client.ts";
293-
*
294277
* const my_client = new Client();
295278
* const { rows } = await my_client.queryArray<[number, string]>({
296279
* text: "SELECT ID, NAME FROM CLIENTS",
@@ -305,7 +288,6 @@ export abstract class QueryClient {
305288
* Execute prepared statements with template strings
306289
*
307290
* ```ts
308-
* import { Client } from "./client.ts";
309291
* const my_client = new Client();
310292
*
311293
* const id = 12;
@@ -353,8 +335,6 @@ export abstract class QueryClient {
353335
* Executed queries and retrieve the data as object entries. It supports a generic in order to type the entries retrieved by the query
354336
*
355337
* ```ts
356-
* import { Client } from "./client.ts";
357-
*
358338
* const my_client = new Client();
359339
*
360340
* const { rows } = await my_client.queryObject(
@@ -374,8 +354,6 @@ export abstract class QueryClient {
374354
* Use the configuration object for more advance options to execute the query
375355
*
376356
* ```ts
377-
* import { Client } from "./client.ts";
378-
*
379357
* const my_client = new Client();
380358
*
381359
* const {rows} = await my_client.queryObject(
@@ -397,8 +375,6 @@ export abstract class QueryClient {
397375
* Execute prepared statements with template strings
398376
*
399377
* ```ts
400-
* import { Client } from "./client.ts";
401-
*
402378
* const my_client = new Client();
403379
* const id = 12;
404380
* // Array<{id: number, name: string}>
@@ -460,8 +436,6 @@ export abstract class QueryClient {
460436
* statements asynchronously
461437
*
462438
* ```ts
463-
* import { Client } from "./client.ts";
464-
*
465439
* const client = new Client();
466440
* await client.connect();
467441
* await client.queryArray`UPDATE MY_TABLE SET MY_FIELD = 0`;
@@ -472,8 +446,6 @@ export abstract class QueryClient {
472446
* for concurrency capabilities check out connection pools
473447
*
474448
* ```ts
475-
* import { Client } from "./client.ts";
476-
*
477449
* const client_1 = new Client();
478450
* await client_1.connect();
479451
* // Even if operations are not awaited, they will be executed in the order they were

pool.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import { DeferredAccessStack } from "./utils/deferred.ts";
1414
* with their PostgreSQL database
1515
*
1616
* ```ts
17-
* import { Pool } from "./pool.ts";
18-
*
1917
* const pool = new Pool({
2018
* database: "database",
2119
* hostname: "hostname",
@@ -35,8 +33,6 @@ import { DeferredAccessStack } from "./utils/deferred.ts";
3533
* available connections in the pool
3634
*
3735
* ```ts
38-
* import { Pool } from "./pool.ts";
39-
*
4036
* // Creates a pool with 10 max available connections
4137
* // Connection with the database won't be established until the user requires it
4238
* const pool = new Pool({}, 10, true);
@@ -119,8 +115,6 @@ export class Pool {
119115
* with the database if no other connections are available
120116
*
121117
* ```ts
122-
* import { Pool } from "./pool.ts";
123-
*
124118
* const pool = new Pool({}, 10);
125119
* const client = await pool.connect();
126120
* await client.queryArray`UPDATE MY_TABLE SET X = 1`;
@@ -141,8 +135,6 @@ export class Pool {
141135
* This will close all open connections and set a terminated status in the pool
142136
*
143137
* ```ts
144-
* import { Pool } from "./pool.ts";
145-
*
146138
* const pool = new Pool({}, 10);
147139
*
148140
* await pool.end();
@@ -154,8 +146,6 @@ export class Pool {
154146
* will reinitialize the connections according to the original configuration of the pool
155147
*
156148
* ```ts
157-
* import { Pool } from "./pool.ts";
158-
*
159149
* const pool = new Pool({}, 10);
160150
* await pool.end();
161151
* const client = await pool.connect();

query/query.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import { type Notice } from "../connection/message.ts";
1414
* They will take the position according to the order in which they were provided
1515
*
1616
* ```ts
17-
* import { Client } from "../client.ts";
18-
*
1917
* const my_client = new Client();
2018
*
2119
* await my_client.queryArray("SELECT ID, NAME FROM PEOPLE WHERE AGE > $1 AND AGE < $2", [

query/transaction.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ export class Savepoint {
6060
* Releasing a savepoint will remove it's last instance in the transaction
6161
*
6262
* ```ts
63-
* import { Client } from "../client.ts";
64-
*
6563
* const client = new Client();
6664
* const transaction = client.createTransaction("transaction");
6765
*
@@ -73,8 +71,6 @@ export class Savepoint {
7371
* It will also allow you to set the savepoint to the position it had before the last update
7472
*
7573
* ```ts
76-
* import { Client } from "../client.ts";
77-
*
7874
* const client = new Client();
7975
* const transaction = client.createTransaction("transaction");
8076
*
@@ -99,8 +95,6 @@ export class Savepoint {
9995
* Updating a savepoint will update its position in the transaction execution
10096
*
10197
* ```ts
102-
* import { Client } from "../client.ts";
103-
*
10498
* const client = new Client();
10599
* const transaction = client.createTransaction("transaction");
106100
*
@@ -114,8 +108,6 @@ export class Savepoint {
114108
* You can also undo a savepoint update by using the `release` method
115109
*
116110
* ```ts
117-
* import { Client } from "../client.ts";
118-
*
119111
* const client = new Client();
120112
* const transaction = client.createTransaction("transaction");
121113
*
@@ -201,8 +193,6 @@ export class Transaction {
201193
* The begin method will officially begin the transaction, and it must be called before
202194
* any query or transaction operation is executed in order to lock the session
203195
* ```ts
204-
* import { Client } from "../client.ts";
205-
*
206196
* const client = new Client();
207197
* const transaction = client.createTransaction("transaction_name");
208198
*
@@ -278,8 +268,6 @@ export class Transaction {
278268
* current transaction and end the current transaction
279269
*
280270
* ```ts
281-
* import { Client } from "../client.ts";
282-
*
283271
* const client = new Client();
284272
* const transaction = client.createTransaction("transaction");
285273
*
@@ -292,8 +280,6 @@ export class Transaction {
292280
* start a new with the same transaction parameters in a single statement
293281
*
294282
* ```ts
295-
* import { Client } from "../client.ts";
296-
*
297283
* const client = new Client();
298284
* const transaction = client.createTransaction("transaction");
299285
*
@@ -353,8 +339,6 @@ export class Transaction {
353339
* the snapshot state between two transactions
354340
*
355341
* ```ts
356-
* import { Client } from "../client.ts";
357-
*
358342
* const client_1 = new Client();
359343
* const client_2 = new Client();
360344
* const transaction_1 = client_1.createTransaction("transaction");
@@ -379,8 +363,6 @@ export class Transaction {
379363
* It supports a generic interface in order to type the entries retrieved by the query
380364
*
381365
* ```ts
382-
* import { Client } from "../client.ts";
383-
*
384366
* const client = new Client();
385367
* const transaction = client.createTransaction("transaction");
386368
*
@@ -391,8 +373,6 @@ export class Transaction {
391373
*
392374
* You can pass type arguments to the query in order to hint TypeScript what the return value will be
393375
* ```ts
394-
* import { Client } from "../client.ts";
395-
*
396376
* const client = new Client();
397377
* const transaction = client.createTransaction("transaction");
398378
*
@@ -404,8 +384,6 @@ export class Transaction {
404384
* It also allows you to execute prepared stamements with template strings
405385
*
406386
* ```ts
407-
* import { Client } from "../client.ts";
408-
*
409387
* const client = new Client();
410388
* const transaction = client.createTransaction("transaction");
411389
*
@@ -422,7 +400,6 @@ export class Transaction {
422400
* Use the configuration object for more advance options to execute the query
423401
*
424402
* ```ts
425-
* import { Client } from "./client.ts";
426403
*
427404
* const my_client = new Client();
428405
* const { rows } = await my_client.queryArray<[number, string]>({
@@ -438,7 +415,6 @@ export class Transaction {
438415
* Execute prepared statements with template strings
439416
*
440417
* ```ts
441-
* import { Client } from "./client.ts";
442418
* const my_client = new Client();
443419
*
444420
* const id = 12;
@@ -489,8 +465,6 @@ export class Transaction {
489465
* Executed queries and retrieve the data as object entries. It supports a generic in order to type the entries retrieved by the query
490466
*
491467
* ```ts
492-
* import { Client } from "./client.ts";
493-
*
494468
* const my_client = new Client();
495469
*
496470
* const { rows } = await my_client.queryObject(
@@ -510,8 +484,6 @@ export class Transaction {
510484
* Use the configuration object for more advance options to execute the query
511485
*
512486
* ```ts
513-
* import { Client } from "./client.ts";
514-
*
515487
* const my_client = new Client();
516488
*
517489
* const {rows} = await my_client.queryObject(
@@ -533,8 +505,6 @@ export class Transaction {
533505
* Execute prepared statements with template strings
534506
*
535507
* ```ts
536-
* import { Client } from "./client.ts";
537-
*
538508
* const my_client = new Client();
539509
* const id = 12;
540510
* // Array<{id: number, name: string}>
@@ -593,8 +563,6 @@ export class Transaction {
593563
* Calling a rollback without arguments will terminate the current transaction and undo all changes.
594564
*
595565
* ```ts
596-
* import { Client } from "../client.ts";
597-
*
598566
* const client = new Client();
599567
* const transaction = client.createTransaction("transaction");
600568
*
@@ -609,8 +577,6 @@ export class Transaction {
609577
* Savepoints can be used to rollback specific changes part of a transaction.
610578
*
611579
* ```ts
612-
* import { Client } from "../client.ts";
613-
*
614580
* const client = new Client();
615581
* const transaction = client.createTransaction("transaction");
616582
*
@@ -633,8 +599,6 @@ export class Transaction {
633599
* The `chain` option allows you to undo the current transaction and restart it with the same parameters in a single statement
634600
*
635601
* ```ts
636-
* import { Client } from "../client.ts";
637-
*
638602
* const client = new Client();
639603
* const transaction = client.createTransaction("transaction");
640604
*
@@ -743,8 +707,6 @@ export class Transaction {
743707
*
744708
* A savepoint can be easily created like this
745709
* ```ts
746-
* import { Client } from "../client.ts";
747-
*
748710
* const client = new Client();
749711
* const transaction = client.createTransaction("transaction");
750712
*
@@ -755,8 +717,6 @@ export class Transaction {
755717
* All savepoints can have multiple positions in a transaction, and you can change or update
756718
* this positions by using the `update` and `release` methods
757719
* ```ts
758-
* import { Client } from "../client.ts";
759-
*
760720
* const client = new Client();
761721
* const transaction = client.createTransaction("transaction");
762722
*
@@ -773,8 +733,6 @@ export class Transaction {
773733
* Creating a new savepoint with an already used name will return you a reference to
774734
* the original savepoint
775735
* ```ts
776-
* import { Client } from "../client.ts";
777-
*
778736
* const client = new Client();
779737
* const transaction = client.createTransaction("transaction");
780738
*

0 commit comments

Comments
 (0)