|
KiCad PCB EDA Suite
|
#include <algorithm>#include <boost/algorithm/string.hpp>#include <boost/locale.hpp>#include <fmt/format.h>#include <nanodbc/nanodbc.h>#include <sql.h>#include <wx/log.h>#include <database/database_connection.h>#include <database/database_cache.h>#include <core/profile.h>Go to the source code of this file.
Classes | |
| struct | RESULT_COLUMN |
Macros | |
| #define | INT64 int64_t |
| #define | UINT64 uint64_t |
Functions | |
| nanodbc::string | fromUTF8 (const std::string &aString) |
| When Unicode support is enabled in nanodbc, string formats are used matching the appropriate character set of the platform. | |
| std::string | toUTF8 (const nanodbc::string &aString) |
| Converts a string from nanodbc-native to KiCad-native. | |
| static std::vector< RESULT_COLUMN > | resultColumns (nanodbc::result &aResults) |
| Column names and types are the same for every row, so read them once per result set. | |
| static void | decodeRow (nanodbc::result &aResults, const std::vector< RESULT_COLUMN > &aColumns, DATABASE_CONNECTION::ROW &aRow) |
| Decodes the current row of a result set into strings keyed by column name. | |
Variables | |
| const char *const | traceDatabase = "KICAD_DATABASE" |
| #define INT64 int64_t |
Definition at line 30 of file database_connection.cpp.
| #define UINT64 uint64_t |
Definition at line 31 of file database_connection.cpp.
|
static |
Decodes the current row of a result set into strings keyed by column name.
Floating-point columns are formatted with {:G} and nulls become empty strings.
Definition at line 108 of file database_connection.cpp.
References RESULT_COLUMN::name, toUTF8(), and RESULT_COLUMN::type.
Referenced by DATABASE_CONNECTION::selectAllAndCache(), DATABASE_CONNECTION::SelectOne(), and DATABASE_CONNECTION::SelectSample().
| nanodbc::string fromUTF8 | ( | const std::string & | aString | ) |
When Unicode support is enabled in nanodbc, string formats are used matching the appropriate character set of the platform.
KiCad uses UTF-8 encoded strings internally, but different platforms use different encodings for SQL strings. Unicode mode must be enabled for compilation on Windows, since Visual Studio forces the use of Unicode SQL headers if any part of the project has Unicode enabled. Converts a string from KiCad-native to nanodbc-native
| aString | is a UTF-8 encoded string |
Definition at line 68 of file database_connection.cpp.
Referenced by DATABASE_CONNECTION::CacheTableInfo(), DATABASE_CONNECTION::Connect(), DATABASE_CONNECTION::GetColumns(), DATABASE_CONNECTION::GetTables(), DATABASE_CONNECTION::selectAllAndCache(), DATABASE_CONNECTION::SelectOne(), and DATABASE_CONNECTION::SelectSample().
|
static |
Column names and types are the same for every row, so read them once per result set.
Definition at line 93 of file database_connection.cpp.
Referenced by DATABASE_CONNECTION::selectAllAndCache(), DATABASE_CONNECTION::SelectOne(), and DATABASE_CONNECTION::SelectSample().
| std::string toUTF8 | ( | const nanodbc::string & | aString | ) |
Converts a string from nanodbc-native to KiCad-native.
| aString | is a string encoded in nanodbc's platform-specific way |
Definition at line 79 of file database_connection.cpp.
Referenced by DATABASE_CONNECTION::CacheTableInfo(), DATABASE_CONNECTION::Connect(), decodeRow(), DATABASE_CONNECTION::GetColumns(), DATABASE_CONNECTION::getQuoteChar(), DATABASE_CONNECTION::GetTables(), DATABASE_CONNECTION::ListDataSourceDetails(), DATABASE_CONNECTION::ListDrivers(), and DATABASE_CONNECTION::SelectOne().
| const char* const traceDatabase = "KICAD_DATABASE" |
Definition at line 53 of file database_connection.cpp.
Referenced by SCH_IO_DATABASE::backgroundRefreshWorker(), DATABASE_CONNECTION::CacheTableInfo(), DATABASE_CONNECTION::columnsFor(), DATABASE_CONNECTION::Connect(), DATABASE_CONNECTION::Disconnect(), SCH_IO_DATABASE::ensureSettings(), DATABASE_CONNECTION::GetColumns(), DATABASE_CONNECTION::getQuoteChar(), DATABASE_CONNECTION::GetTables(), DATABASE_CONNECTION::ListDataSourceDetails(), DATABASE_CONNECTION::ListDrivers(), SCH_IO_DATABASE::LoadSymbol(), SCH_IO_DATABASE::loadSymbolFromRow(), DATABASE_CONNECTION::SelectAll(), DATABASE_CONNECTION::selectAllAndCache(), DATABASE_CONNECTION::SelectOne(), DATABASE_CONNECTION::SelectSample(), and SCH_IO_DATABASE::startBackgroundRefresh().