223619 {
223620 Parser parser;
223621 parser.ParseQuery(query);
223622 auto copy_statements = std::move(parser.statements);
223623 query.clear();
223624 for (auto &statement_p : copy_statements) {
223625 D_ASSERT(statement_p->type == StatementType::COPY_STATEMENT);
223626 auto &statement = statement_p->Cast<CopyStatement>();
223627 auto &info = *statement.info;
223628 auto file_name = fs.ExtractName(info.file_path);
223629 info.file_path = fs.JoinPath(parameters.values[0].ToString(), file_name);
223630 query += statement.ToString() + ";";
223631 }
223632 }
223633 final_query += query;
223634 }
223635 return final_query;
223636}
223637
223638static string PragmaCopyDatabase(ClientContext &context, const FunctionParameters ¶meters) {