-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add --where helper for select queries
Now we can add some basic filtering when using the query helpers. Refs #136
- Loading branch information
Showing
3 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -517,6 +517,24 @@ subtest 'query' => sub { | |
email => '[email protected]', | ||
}, | ||
); | ||
|
||
subtest '--where' => sub { | ||
my ( $stdout, $stderr, $exit ) = capture { | ||
ysql->main( 'testdb', '--select', 'person', '--where', 'id >= 2' ); | ||
}; | ||
is $exit, 0; | ||
ok !$stderr, 'nothing on stderr' or diag $stderr; | ||
|
||
open my $fh, '<', \$stdout; | ||
my $yaml_fmt = ETL::Yertl::Format::yaml->new( input => $fh ); | ||
cmp_deeply [ $yaml_fmt->read ], bag( | ||
{ | ||
id => 2, | ||
name => 'Quentin Quinn', | ||
email => '[email protected]', | ||
}, | ||
); | ||
}; | ||
}; | ||
|
||
subtest '--insert' => sub { | ||
|