KiCad PCB EDA Suite
Loading...
Searching...
No Matches
database_connection.cpp File Reference
#include <boost/locale.hpp>
#include <fmt/core.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.

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.
 

Variables

const char *const traceDatabase = "KICAD_DATABASE"
 

Macro Definition Documentation

◆ INT64

#define INT64   int64_t

Definition at line 27 of file database_connection.cpp.

◆ UINT64

#define UINT64   uint64_t

Definition at line 28 of file database_connection.cpp.

Function Documentation

◆ fromUTF8()

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

Parameters
aStringis a UTF-8 encoded string
Returns
a string in nanodbc's platform-specific representation

Definition at line 65 of file database_connection.cpp.

Referenced by DATABASE_CONNECTION::CacheTableInfo(), DATABASE_CONNECTION::Connect(), DATABASE_CONNECTION::selectAllAndCache(), and DATABASE_CONNECTION::SelectOne().

◆ toUTF8()

std::string toUTF8 ( const nanodbc::string &  aString)

Converts a string from nanodbc-native to KiCad-native.

Parameters
aStringis a string encoded in nanodbc's platform-specific way
Returns
a string with UTF-8 encoding

Definition at line 76 of file database_connection.cpp.

Referenced by DATABASE_CONNECTION::CacheTableInfo(), DATABASE_CONNECTION::getQuoteChar(), DATABASE_CONNECTION::selectAllAndCache(), and DATABASE_CONNECTION::SelectOne().

Variable Documentation

◆ traceDatabase