Created
March 21, 2017 20:01
-
-
Save nicomen/19131c991f7f0a6f5eda9b1c0ed66793 to your computer and use it in GitHub Desktop.
get valid sqlite table and column names for sqlite3
This file contains hidden or 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
✔ 21:00 ~ $ cat sql_abs.pl | |
#!/usr/bin/perl | |
use feature 'say'; | |
use SQL::Abstract; | |
my $abs = SQL::Abstract->new(); | |
say join ',', $abs->select('my_table', [ 'my_table.my_id' ], { my_id => '1' }); | |
my $abs = SQL::Abstract->new( quote_char => '`' ); | |
say join ',', $abs->select('my_table', [ 'my_table.my_id' ], { my_id => '1' }); | |
✔ 21:00 ~ $ perl sql_abs.pl | |
SELECT my_table.my_id FROM my_table WHERE ( my_id = ? ),1 | |
SELECT `my_table.my_id` FROM `my_table` WHERE ( `my_id` = ? ),1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment