Answer the question
In order to leave comments, you need to log in
Is there a SQL code generator in C++ for several databases at once (MySQL, SQLite, MS SQL)?
Hello.
I am looking for a C++ library that standardizes the generation of SQL queries and work with different databases: MySQL, SQLite, MS SQL.
Is there a ready solution to not write your bike?
Looking for something simple and lightweight. Or alternatively - popular in the community.
More about the problem:
Periodically, you have to write programs that work with different databases.
The programs are generally simple:
- check for the presence of a table and create a table,
- check for the presence of a field in the table, check the type of the field and edit the fields of the table
- perform SELECT, INSERT and UPDATE and read the result, or handle an error.
But as they say, the devil is in the details. For example, autoincrement can be written in different ways.
For MySQL, 'AUTO_INCREMENT' is used:
CREATE TABLE MyTable (
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id)
);
CREATE TABLE MyTable
(
id INTEGER PRIMARY KEY IDENTITY(1,1)
);
CREATE TABLE `MyTable` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question