mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
[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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user