Skip to content

Commit 8ada5d2

Browse files
committed
Add statement to inspect, sort alphabetically
1 parent b01fa16 commit 8ada5d2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/index.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -66,34 +66,35 @@ export class Sql {
6666
}
6767
}
6868

69-
get text() {
69+
get sql() {
7070
const len = this.strings.length;
7171
let i = 1;
7272
let value = this.strings[0];
73-
while (i < len) value += `$${i}${this.strings[i++]}`;
73+
while (i < len) value += `?${this.strings[i++]}`;
7474
return value;
7575
}
7676

77-
get sql() {
77+
get statement() {
7878
const len = this.strings.length;
7979
let i = 1;
8080
let value = this.strings[0];
81-
while (i < len) value += `?${this.strings[i++]}`;
81+
while (i < len) value += `:${i}${this.strings[i++]}`;
8282
return value;
8383
}
8484

85-
get statement() {
85+
get text() {
8686
const len = this.strings.length;
8787
let i = 1;
8888
let value = this.strings[0];
89-
while (i < len) value += `:${i}${this.strings[i++]}`;
89+
while (i < len) value += `$${i}${this.strings[i++]}`;
9090
return value;
9191
}
9292

9393
inspect() {
9494
return {
95-
text: this.text,
9695
sql: this.sql,
96+
statement: this.statement,
97+
text: this.text,
9798
values: this.values,
9899
};
99100
}

0 commit comments

Comments
 (0)