Questions tagged [soci]

SOCI is a database access library for C++ that makes the illusion of embedding SQL queries in the regular C++ code, staying entirely within the Standard C++. The idea is to provide C++ programmers a way to access SQL databases in the most natural and intuitive way.

104 questions
1
vote
4 answers

Using SOCI (sql wrapper) on Xubuntu, simple program fails while compilig

I want to finally get to know how to write an application which uses database. I chose C++, PostgreSQL and SOCI (SQL wrapper to C++). I use Xubuntu 11.4 and installed everyting which was necessary to run a simple program. To use SOCI I…
Brian Brown
  • 3,873
  • 16
  • 48
  • 79
1
vote
2 answers

Soci Session is not releasing connection

I'm using soci for making my app interact with databases and currently I use MySQL server to test. I have wrapped SOCI into simple class where I call session.open() in Connect method of my class m_session.open(soci::mysql, connString); Then in…
Stefano Mtangoo
  • 6,017
  • 6
  • 47
  • 93
0
votes
0 answers

SOCI Database Library how to reconnect to Database with ODBC Backend

i am using SOCI Database Lib. I have in my c++ program a timer that checks every x seconds if the connection to the Database still working, using ODBC backend in SOCI. If the program detects that the connection is broken (testquery didn't work), i…
Sascha B
  • 1
  • 1
0
votes
0 answers

Properly Installing SOCI C++ library and using it with eclipse

I have been trying to employ SOCI library for the c++ project I am working on as I needed to access MySQL databases. I have been wrapping my head around how exactly this library works in terms of installing. I have windows 11 and want to use the…
Evank800
  • 17
  • 3
0
votes
1 answer

Malloc allocates more memory then needed when using soci::use

While investigating a strange tcmalloc error, my colleague and I traced the error to one line of code: soci::session db; ... db << "INSERT INTO `public.tablename` (..., ..., textvalue) VALUES ('...', '...', :1);", …
0
votes
1 answer

Cmake unable to find PostgreSQL libraries When compiling SOCI

OS: Windows 10 Compiler: Visual Studio 2019 SOCI Version: 4.0.2 PostgreSQL Version: 13 CMake VersionL 3.20.3 I'm not too familiar with CMake so bear with me if I'm doing something uninformed and incorrectly. Steps: Download and execute…
0
votes
0 answers

Order of bulk insertion in SOCI/Postgresql

I am inserting records into a Postgresql table using the bulk insertion capability of SOCI C++ library. The data is passed to SOCI in std::vectors and the table contains an automatic counter of SERIAL type. I expected that the records will be…
0
votes
2 answers

Why is the C++ compiler not detecting a properly declared Class?

According to the error codes, the compiler (MSVC 2019) is not detecting properly declared classes. In the following code, the compiler halts at the first mention of UACvLogin in the UACcDefault class…
J Vines
  • 182
  • 1
  • 16
0
votes
1 answer

How do I build the SOCI library without errors?

I am having difficulties building the SOCI library. Relevant software: Boost ver 1.73.0 CMake ver 3.16 MSVC compiler ver 19.26.28805.0 MySQL ver 5.7 SOCI ver 4.0.0 Relevant paths: Path to Boost is E:\cpp\Lib\boost\boost_1_73_0. Path to CMake is…
J Vines
  • 182
  • 1
  • 16
0
votes
0 answers

Accessing a remote database using MySQL with the SOCI C++ library from a docker container

I have some C++ code that connects to a remote database to obtain some data. But now I'm trying to make the whole system work inside a docker container and I'm having problems, specially because I don't know a lot about connections, network…
David Moreno
  • 141
  • 9
0
votes
1 answer

What is the limit of the returned rows from a select statement for the SOCI Firebird backend?

Using SOCI Firebird v4.0 trunk to Read/Write data from/to a Firebird database. The problem is, when I select all the rows from a table that are over 2 million rows via a select statement, SOCI throws an std::bad_alloc exception and I get only…
user10076428
0
votes
0 answers

is it possible to extend soci and use wxVector instead of vector for bulk operations?

is it possible to extend soci database library and use wxVector instead of std::vector for bulk operations? I know how to extend the basic data-types, but for bulk operations, I have no idea.
user10076428
0
votes
1 answer

SOCI data types in wxWidgets applications

I have started a new simple wxWidgets application, and then added support to firebird database acces using SOCI. I want to know if it is possible to use data types like wxString and wxDateTime bacause I have already designed my table structre…
user10076428
0
votes
1 answer

Unable to connet to SQL server using soci library

I am beginner in c++,my problem on Linux for connecting to SQL Server with soci library, my code this but I have error and I don't found solution for my problem, my code this: I have error: [unixODBC][Driver Manager]Data source name not found, and…
Mojtaba Safavi
  • 127
  • 2
  • 10
0
votes
1 answer

Variable binding using soci with PL/pgSQL

I'm using SOCI library to execute database queries on both Oracle and PostgreSQL databases. I got the following error : Cannot execute query. Fatal error. ERROR: bind message supplies 1 parameters, but prepared statement "" requires 0" When I…
Amith Chinthaka
  • 1,015
  • 1
  • 17
  • 24