Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 examples/db/sql_statement_with_params.slang
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Rule unknown ignore

Given I connect to 'database' and send statement 'statement' and send parameters 'parameters' and execute sql statement with parameters and output into 'result'
Given I connect to 'database' and send statement 'statement' and send parameters 'parameters' and execute parametrized sql statement and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the 'result'
2 changes: 1 addition & 1 deletion pkg/db/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const execute = p.new('connect',

export const executeParams = p.new('connect',
['statement', 'parameters'],
'execute sql statement with parameters',
'execute parametrized sql statement',
async (ctx) => {
const statement = ctx.fetch('statement') as string;
const parameters = ctx.fetch('parameters') as BindOrReplacements;
Expand Down
12 changes: 6 additions & 6 deletions pkg/db/test/raw_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ test('Db should execute raw queries', async (t) => {
Given I connect to 'database' and send statement 'query_2' and execute sql statement and output into 'result_2'
Given I connect to 'database' and send statement 'query_3' and execute sql statement and output into 'result_3'
Given I connect to 'database' and send statement 'query_4' and execute sql statement and output into 'result_4'
Given I connect to 'database' and send statement 'query_5' and send parameters 'query5_params' and execute sql statement with parameters and output into 'result_5'
Given I connect to 'database' and send statement 'query_6' and send parameters 'query6_params' and execute sql statement with parameters and output into 'result_6'
Given I connect to 'database' and send statement 'query_5' and send parameters 'query5_params' and execute parametrized sql statement and output into 'result_5'
Given I connect to 'database' and send statement 'query_6' and send parameters 'query6_params' and execute parametrized sql statement and output into 'result_6'
Given I have a 'string dictionary' named 'result_1'
Given I have a 'string dictionary' named 'result_2'
Given I have a 'string dictionary' named 'result_3'
Expand Down Expand Up @@ -85,7 +85,7 @@ test('Db should execute raw queries', async (t) => {
test('Db should fail for wrong database', async (t) => {
const rawQuery = `Rule unknown ignore
Given I connect to 'database' and send statement 'query_1' and execute sql statement and output into 'result_1'
Given I connect to 'database' and send statement 'query_5' and send parameters 'query5_params' and execute sql statement with parameters and output into 'result_5'
Given I connect to 'database' and send statement 'query_5' and send parameters 'query5_params' and execute parametrized sql statement and output into 'result_5'
Given I have a 'string dictionary' named 'result_1'
Given I have a 'string dictionary' named 'result_5'
Then print all data
Expand All @@ -105,7 +105,7 @@ test('Db should fail for wrong database', async (t) => {
`0 | Rule unknown ignore
1 | Given I connect to 'database' and send statement 'query_1' and execute sql statement and output into 'result_1'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Given I connect to 'database' and send statement 'query_5' and send parameters 'query5_params' and execute sql statement with parameters and output into 'result_5'
2 | Given I connect to 'database' and send statement 'query_5' and send parameters 'query5_params' and execute parametrized sql statement and output into 'result_5'
3 | Given I have a 'string dictionary' named 'result_1'

Error colors:
Expand All @@ -132,7 +132,7 @@ Heap:
test('Db should fail for wrong statement', async (t) => {
const rawQuery = `Rule unknown ignore
Given I connect to 'database' and send statement 'query_1' and execute sql statement and output into 'result_1'
Given I connect to 'database' and send statement 'query_5' and send parameters 'query5_params' and execute sql statement with parameters and output into 'result_5'
Given I connect to 'database' and send statement 'query_5' and send parameters 'query5_params' and execute parametrized sql statement and output into 'result_5'
Given I have a 'string dictionary' named 'result_1'
Given I have a 'string dictionary' named 'result_5'
Then print all data
Expand All @@ -152,7 +152,7 @@ test('Db should fail for wrong statement', async (t) => {
`0 | Rule unknown ignore
1 | Given I connect to 'database' and send statement 'query_1' and execute sql statement and output into 'result_1'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Given I connect to 'database' and send statement 'query_5' and send parameters 'query5_params' and execute sql statement with parameters and output into 'result_5'
2 | Given I connect to 'database' and send statement 'query_5' and send parameters 'query5_params' and execute parametrized sql statement and output into 'result_5'
3 | Given I have a 'string dictionary' named 'result_1'

Error colors:
Expand Down
Loading