Git Product home page Git Product logo

wxdatabase's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @mtangoo
  • ๐Ÿ‘€ Iโ€™m interested in God, family and technologies!
  • ๐ŸŒฑ Iโ€™m currently learning how to better serve God, lead men and women, and use coding for good!
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on variety of open-source projects
  • ๐Ÿ“ซ Email me at [email protected]

wxdatabase's People

Contributors

faldon avatar ghaberek avatar iwbnwif avatar manyleaves avatar mtangoo avatar patlkli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wxdatabase's Issues

Online docs missing?

README.md states that documentation can be found online:

wxDatabase documentation is built with Doxygen. Download the latest version and follow the procedure in the next paragraph to build API documentation. You can view documentation on line at mtangoo.github.io.

However, that page simply says Hello World and nothing more.

PGS: Replace PQsetdbLogin with PQconnectdb

PQconnectdb Makes a new connection to the database server.
PGconn *PQconnectdb(const char *conninfo);

This function opens a new database connection using the parameters taken from the string conninfo.
The passed string can be empty to use all default parameters, or it can contain one or more parameter settings separated by whitespace, or it can contain a URI. See Section 31.1.1 for details.
PQsetdbLogin Makes a new connection to the database server.

PGconn *PQsetdbLogin(const char *pghost,
                     const char *pgport,
                     const char *pgoptions,
                     const char *pgtty,
                     const char *dbName,
                     const char *login,
                     const char *pwd);

This is the predecessor of PQconnectdb with a fixed set of parameters. It has the same functionality except that the missing parameters will always take on default values. Write NULL or an empty string for any one of the fixed parameters that is to be defaulted.
If the dbName contains an = sign or has a valid connection URI prefix, it is taken as a conninfo string in exactly the same way as if it had been passed to PQconnectdb, and the remaining parameters are then applied as specified for PQconnectdbParams.

Remove Exceptions

In wxWidgets coding guidelines exceptions are discouraged. This ticket aim at removing all exceptions in the library.

The idea I have is to have a class similar to QT SQLError. For function that can return bool (like Commit) will do so and for the rest, checking the error it will be something like

wxDatabase *pDatabase =  new wxMysqlDatabase(strServer, strDatabase, strUser, strPassword);
wxSQLError *error = pDatabase->GetLastError();
if(error->GetCode() == 0)
{
    //success
}
else
{
    //unsuccesful
    error->GetText();
    error->GetCode();
}

What do you think @patlkli @manyleaves and whoever reads this ;) ?

wxDatabase and WXwidget 3.0.5

I'm trying to build wxDatabase for the MinGW compiler. Below is the build log with an error. what am I doing wrong? Thank you all in advance for your help!
c:\Library\wxDatabase\build>mingw32-make -f makefile WX_SHARED=1 WX_MONOLITHIC=1 WX_UNICODE=1 WX_DEBUG=0 WX_DIR="c:\Library\wxwidgets" [ 5%] Building CXX object CMakeFiles/wxdatabase.dir/src/base/dbconf.cpp.obj [ 10%] Building CXX object CMakeFiles/wxdatabase.dir/src/base/wxprec.cpp.obj [ 15%] Building CXX object CMakeFiles/wxdatabase.dir/src/base/xmlconf.cpp.obj [ 21%] Building CXX object CMakeFiles/wxdatabase.dir/src/database/database.cpp.obj [ 26%] Building CXX object CMakeFiles/wxdatabase.dir/src/database/error_reporter.cpp.obj [ 31%] Building CXX object CMakeFiles/wxdatabase.dir/src/database/prepared_statement.cpp.obj [ 36%] Building CXX object CMakeFiles/wxdatabase.dir/src/database/query_parser.cpp.obj [ 42%] Building CXX object CMakeFiles/wxdatabase.dir/src/database/resultset.cpp.obj [ 47%] Building CXX object CMakeFiles/wxdatabase.dir/src/database/string_converter.cpp.obj [ 52%] Building CXX object CMakeFiles/wxdatabase.dir/src/database/wxprec.cpp.obj [ 57%] Building CXX object CMakeFiles/wxdatabase.dir/src/database/odbc/odbc_database.cpp.obj [ 63%] Building CXX object CMakeFiles/wxdatabase.dir/src/database/odbc/odbc_inteface.cpp.obj [ 68%] Building CXX object CMakeFiles/wxdatabase.dir/src/database/odbc/odbc_param.cpp.obj C:\Library\wxDatabase\src\database\odbc\odbc_param.cpp: In member function 'SQLLEN* wxOdbcParameter::GetParameterLengthPtr()': C:\Library\wxDatabase\src\database\odbc\odbc_param.cpp:255:11: error: cannot convert 'long int*' to 'SQLLEN*' {aka 'long long int*'} in return return &m_nBufferLength; ^~~~~~~~~~~~~~~ mingw32-make[2]: *** [CMakeFiles\wxdatabase.dir\build.make:256: CMakeFiles/wxdatabase.dir/src/database/odbc/odbc_param.cpp.obj] Error 1 mingw32-make[1]: *** [CMakeFiles\Makefile2:84: CMakeFiles/wxdatabase.dir/all] Error 2 mingw32-make: *** [makefile:135: all] Error 2

Add Support for TDS in CMake

So far CMake build have Support for SQLite3, MySQL/MariaDB, and PostGreSQL. I would like to see TDS Suported so that one can connect with MS SQL Server. I'm not TDS guy and so its hard for me to sdo it.

Help is needed

Redefinition of struct timespec (PostgreSQL vs mingw-w64)

This is not really a wxDatabase issue, but a PostgreSQL / mingw-w64 issue. I am including it here because it prevents wxDatabase from building and there is not much help on Google at the moment.

Basically both PostgreSQL pthread.h and mingw-w64 gthr.h define the struct timespec.

The workaround from a wxDatabase perspective is to include:

    add_definitions(-DHAVE_STRUCT_TIMESPEC)

in the ENABLE_PGS block of CMakeLists.txt.

wxWidgets 3.1.5 and wxDatabase and ODBC

Good day! Tell me how to use ODBC correctly with MS SQL server? I am using wxWidgets 3.1.5 and wxDatabase. The wxDatabaseApp.cpp example builds fine. I am trying to change it to work with ODBC, but looking at the source code in the CodeBlocks project, I see that the wxUSE_DATABASE_ODBC preprocessor directive is not set. And the code is copied without ODBC support. Also how to properly link the wxDatabase library to the new project? Sorry for the silly questions, not strong enough in C ++ yet.
cmake
codeblocks

I am trying to connect to MS SQL server using the following connection string
pDatabase = GetDatabase ("[ODBC] \ nConnection = DRIVER = SQL Server; SERVER = 10.9.1.50; DATABASE = apacs24ms; UID = user; PWD = password;");

CMake can't find PostgreSQL headers on Ubuntu/Debian

On a standard Debian/Ubuntu, the pg_type.h header from the postgresql-server-dev-* packages aren't found by the FindPostgreSQL.cmake module, because they are in a different directory.

CMake Error at /usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
  Could NOT find PostgreSQL (missing: PostgreSQL_TYPE_INCLUDE_DIR) (found
  version "9.4.5")
Call Stack (most recent call first):
  /usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.0/Modules/FindPostgreSQL.cmake:159 (find_package_handle_standard_args)
  CMakeLists.txt:104 (find_package)

This commit in CMake fixes this, but the version of CMake in the Debian repositories doesn't include that yet.

I suggest that in the meantime, we simply bundle the new FindPostgreSQL.cmake from that commit in the cmake/Modules directory together with the other find modules.

Let me know what you think, I have the commits ready to go.

Possible memory leak in MySQL sample?

In the MySQL sample a new wxMysqlDatabase is instantiated at line 34, but isn't deleted.

This might be my understanding of the MySQL backend code, sorry for wasting time if so.

On the other hand if this is a bug, then perhaps it would be worth thinking about using some of the wxWidgets smart pointers here. Also for result sets because it would avoid having to close them each time, they would simply go out of focus and be deleted.

Add Firebird backend

I would like to propose implementing a Firebird backend based on IBPP.

This would make IBPP a sort of dependency, but given it comes as open source .cpp and .h files it can live in /vendors.

If this is approved then it would be a thinish wrapper around IBPP rather than an update of the wxDatabaseLayer Firebird backend. In future IBPP might be replaced by the new Firebird 3 OO API, but we should wait for things to stabilize first.

Working with ODBC with a graphical interface.

Good evening, could you add an example of working with ODBC in a graphical interface to the library? As it is not clear, you need to create a wxDatabase object or a wxOdbcDatabase object.
Also, there is still a question about building the library in the Cmake gui, why is it that when specifying the use of odbc, the library is built with the preprocessor directive wxUSE_DATABASE_ODBC off. How should CMakeLists.txt be changed for correct assembly to work through ODBC?
2021-11-22_215010
The application from the samples folder builds and runs, but it uses the parent of all database classes. And on the forum https://forums.wxwidgets.org/viewtopic.php?f=34&t=48736&p=209286#p209286 it is advised to use the odbc constructor, not an abstract class.

PGS: Fix Perfomance issue

From PGS Docs page

Note: On Windows, there is a way to improve performance if a single database connection is repeatedly started and shutdown. Internally, libpq calls WSAStartup() and WSACleanup() for connection startup and shutdown, respectively. WSAStartup() increments an internal Windows library reference count which is decremented by WSACleanup(). When the reference count is just one, calling WSACleanup() frees all resources and all DLLs are unloaded. This is an expensive operation. To avoid this, an application can manually call WSAStartup() so resources will not be freed when the last database connection is closed.

Fix this in PGS port

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.