[Repositories] Insert repository improvements (#1236)

* Insert repository improvements

* Remove no longer necessary code, remove license banner since we have a license at the repo level

* Update template comments
This commit is contained in:
Chris Miles
2021-02-08 20:56:44 -06:00
committed by GitHub
parent 694d380e66
commit 96b65b848b
161 changed files with 1473 additions and 6318 deletions
@@ -266,17 +266,15 @@ foreach my $table_to_generate (@tables) {
);
}
# insert one
if ($extra ne "auto_increment") {
my $value = sprintf("\"'\" + EscapeString(%s_entry.%s) + \"'\"", $table_name, $column_name);
if ($data_type =~ /int|float|double|decimal/) {
$value = sprintf('std::to_string(%s_entry.%s)', $table_name, $column_name);
}
$insert_one_entries .= sprintf("\t\tinsert_values.push_back(%s);\n", $value);
$insert_many_entries .= sprintf("\t\t\tinsert_values.push_back(%s);\n", $value);
# insert
my $value = sprintf("\"'\" + EscapeString(%s_entry.%s) + \"'\"", $table_name, $column_name);
if ($data_type =~ /int|float|double|decimal/) {
$value = sprintf('std::to_string(%s_entry.%s)', $table_name, $column_name);
}
$insert_one_entries .= sprintf("\t\tinsert_values.push_back(%s);\n", $value);
$insert_many_entries .= sprintf("\t\t\tinsert_values.push_back(%s);\n", $value);
# find one / all (select)
if ($data_type =~ /int/) {
$all_entries .= sprintf("\t\t\tentry.%-${longest_column_length}s = atoi(row[%s]);\n", $column_name, $index);