Skip to content

Commit

Permalink
Use correct naming in readme (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
leo authored Nov 11, 2024
1 parent 4250b0a commit 2b9b406
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ To fine-tune the behavior of the compiler, you can pass the following options:

```typescript
compileQueries(queries, schemas, {
// Instead of returning an array of values for every statement (which allows for
// preventing SQL injections), all values are inlined directly into the SQL strings.
// Instead of returning an array of parameters for every statement (which allows for
// preventing SQL injections), all parameters are inlined directly into the SQL strings.
// This option should only be used if the generated SQL will be manually verified.
inlineValues: true
inlineParams: true
});
```

Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const compileQueries = (
queries: Array<Query>,
schemas: Array<PublicSchema>,
options?: {
inlineValues?: boolean;
inlineParams?: boolean;
},
): Array<Statement> => {
const schemaList = addSystemSchemas(schemas).map((schema) => {
Expand All @@ -38,7 +38,7 @@ export const compileQueries = (
const result = compileQueryInput(
query,
schemaListWithPresets,
options?.inlineValues ? null : [],
options?.inlineParams ? null : [],
);

// Every query can only produce one main statement (which can return output), but
Expand Down
2 changes: 1 addition & 1 deletion tests/options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test('inline statement values', () => {
];

const statements = compileQueries(queries, schemas, {
inlineValues: true,
inlineParams: true,
});

expect(statements).toEqual([
Expand Down

0 comments on commit 2b9b406

Please sign in to comment.