Giter Site home page Giter Site logo

gittiver / litesql Goto Github PK

View Code? Open in Web Editor NEW
27.0 3.0 6.0 10.59 MB

LiteSQL is a C++ ORM (object relational mapper) consisting of a codegenerator and C++ library that integrates C++ objects tightly to relational database and thus provides an object persistence layer. LiteSQL supports SQLite3, PostgreSQL, MySQL and oracle as backends.

Home Page: https://gittiver.github.io/litesql

License: Other

CMake 2.65% Makefile 12.74% Shell 26.88% M4 0.40% C++ 31.95% C 25.29% Batchfile 0.09%
orm sql codegenerator persistence relational-databases persistence-layer backend mysql database oracle

litesql's Introduction

LiteSQL - C++ Object-Relational Persistence Framework

Build and test (cmake based build) Documentation travis CI Appveyour Build status

LiteSQL is a C++ library that integrates C++ objects tightly to relational database and thus provides an object persistence layer. LiteSQL supports SQLite3, PostgreSQL and MySQL as backends. LiteSQL creates tables, indexes and sequences to database and upgrades schema when needed. In addition to object persistence, LiteSQL provides object relations which can be used to model basic OO building blocks (aggregation, composition, association). Objects can be selected, filtered and ordered using template- and class-based API with type checking at compile time.

Features

  • SQLite3, PostgreSQL, MySQL and Oracle-backend support
  • C++ object persistence (store, update, retrieve)
  • relational operations (filtering, ordering, referencing other objects)
  • automatic database structure maintenance (creates, updates and drops tables/indices behind the scenes)
  • C++ template based database API -> no SQL queries by hand

License

This library is distributed under the terms of [BSD-License](@ref bsd_license)

Status

0.3.x version is a proof-of-concept implementation, works for non-critical use

Download

Please continue to the Download page.

Mailing List

Discussion about the library (help requests, new ideas, etc.) is very welcome at litesql-users mailing list

Contributions Welcome

There is a lot of interesting tasks available (the list of active tickets). Please acknowledge the license of the project before contributing. Only contributions that can be released under the license will be included.

Documentation

litesql's People

Contributors

aii-wei avatar gittiver 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

Watchers

 avatar  avatar  avatar

litesql's Issues

Cursor issue

Hello i have error on compile that code:
Cursor cur = db.cursor(SelectQuery().result("name_").source("Group_"));
for (;!cur.rowsLeft(); cur++) { cout << (*cur).data()->c_str() << endl; }

////////////////////////////////////////

C:\Users\Admin\Projects\Test\LiteSQL\include\litesql.hpp:11: In file included from ..\Test\LiteSQL\include/litesql.hpp:11:0,
In file included from ..\Test\LiteSQL\include/litesql.hpp:11:0,
from ..\Test\globals.h:10,
from ..\Test\productAdd.h:2,
from ..\Test\productAdd.cpp:1:
..\Test\LiteSQL\include/litesql/types.hpp:23:5: note: candidate: litesql::Record::Record(size_t)
Record(size_t reserved) { reserve(reserved); }
^~~~~~
..\Test\LiteSQL\include/litesql/types.hpp:23:5: note: candidate expects 1 argument, 2 provided
..\Test\LiteSQL\include/litesql/types.hpp:22:5: note: candidate: litesql::Record::Record()
Record() : std::vectorstd::string() {}
^~~~~~
..\Test\LiteSQL\include/litesql/types.hpp:22:5: note: candidate expects 0 arguments, 2 provided
..\Test\LiteSQL\include/litesql/types.hpp:19:7: note: candidate: litesql::Record::Record(const litesql::Record&)
class Record : public std::vectorstd::string
^~~~~~
..\Test\LiteSQL\include/litesql/types.hpp:19:7: note: candidate expects 1 argument, 2 provided
..\Test\LiteSQL\include/litesql/types.hpp:19:7: note: candidate: litesql::Record::Record(litesql::Record&&)
..\Test\LiteSQL\include/litesql/types.hpp:19:7: note: candidate expects 1 argument, 2 provided

postgresql error : DatabaseError: could not load plugin

Modify the database type in the example to postgresql:

ExampleDatabase db("postgresql", "host=localhost;database=test-update-table;user=litesql;password=litesql");

got this error:

joo
liblitesql_backend_postgresql.so: cannot open shared object file: No such file or directory
DatabaseError: could not load plugin

is it possible to support litesql_postgresql_backend lib?

centos 8 stream . configure error:

./configure: line 4479: syntax error near unexpected token set' ./configure: line 4479: set dummy doxygen; ac_word=$2'

line 4476 : AX_CXX_COMPILE_STDCXX_11() casue the error.

centos 8 stream: mysql 8.0.17 make errros. MYSQL name conflict

In file included from /usr/include/mysql/mysql.h:84,
from mysql.cpp:17:
/usr/include/mysql/mysql/client_plugin.h:108:8: error: using typedef-name ‘MYSQL’ after ‘struct’
struct MYSQL;
^~~~~
In file included from mysql.cpp:7:
./../../include/mysql.hpp:20:25: note: ‘MYSQL’ has a previous declaration here
typedef struct st_mysql MYSQL;
^~~~~
In file included from /usr/include/mysql/mysql.h:84,
from mysql.cpp:17:
/usr/include/mysql/mysql/client_plugin.h:115:58: error: using typedef-name ‘MYSQL’ after ‘struct’
int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct MYSQL *mysql);
^~~~~
In file included from mysql.cpp:7:
./../../include/mysql.hpp:20:25: note: ‘MYSQL’ has a previous declaration here
typedef struct st_mysql MYSQL;
^~~~~
In file included from /usr/include/mysql/mysql.h:84,
from mysql.cpp:17:
/usr/include/mysql/mysql/client_plugin.h:117:65: error: using typedef-name ‘MYSQL’ after ‘struct’
struct MYSQL *mysql,
^~~~~
In file included from mysql.cpp:7:
./../../include/mysql.hpp:20:25: note: ‘MYSQL’ has a previous declaration here
typedef struct st_mysql MYSQL;
^~~~~
In file included from /usr/include/mysql/mysql.h:84,
from mysql.cpp:17:
/usr/include/mysql/mysql/client_plugin.h:139:57: error: using typedef-name ‘MYSQL’ after ‘struct’
struct st_mysql_client_plugin *mysql_load_plugin(struct MYSQL *mysql,
^~~~~
In file included from mysql.cpp:7:
./../../include/mysql.hpp:20:25: note: ‘MYSQL’ has a previous declaration here
typedef struct st_mysql MYSQL;
^~~~~
In file included from /usr/include/mysql/mysql.h:84,
from mysql.cpp:17:
/usr/include/mysql/mysql/client_plugin.h:159:59: error: using typedef-name ‘MYSQL’ after ‘struct’
struct st_mysql_client_plugin *mysql_load_plugin_v(struct MYSQL *mysql,
^~~~~
In file included from mysql.cpp:7:
./../../include/mysql.hpp:20:25: note: ‘MYSQL’ has a previous declaration here
typedef struct st_mysql MYSQL;
^~~~~
In file included from /usr/include/mysql/mysql.h:84,
from mysql.cpp:17:
/usr/include/mysql/mysql/client_plugin.h:173:64: error: using typedef-name ‘MYSQL’ after ‘struct’
struct st_mysql_client_plugin *mysql_client_find_plugin(struct MYSQL *mysql,
^~~~~
In file included from mysql.cpp:7:
./../../include/mysql.hpp:20:25: note: ‘MYSQL’ has a previous declaration here
typedef struct st_mysql MYSQL;
^~~~~
In file included from /usr/include/mysql/mysql.h:84,
from mysql.cpp:17:
/usr/include/mysql/mysql/client_plugin.h:192:12: error: using typedef-name ‘MYSQL’ after ‘struct’
struct MYSQL *mysql, struct st_mysql_client_plugin *plugin);
^~~~~
In file included from mysql.cpp:7:
./../../include/mysql.hpp:20:25: note: ‘MYSQL’ has a previous declaration here
typedef struct st_mysql MYSQL;
^~~~~
In file included from mysql.cpp:17:
/usr/include/mysql/mysql.h:294:16: error: using typedef-name ‘MYSQL’ after ‘struct’
typedef struct MYSQL {
^~~~~
In file included from mysql.cpp:7:
./../../include/mysql.hpp:20:25: note: ‘MYSQL’ has a previous declaration here
typedef struct st_mysql MYSQL;
^~~~~
In file included from mysql.cpp:17:
/usr/include/mysql/mysql.h:332:3: error: conflicting declaration ‘typedef int MYSQL’
} MYSQL;
^~~~~
In file included from mysql.cpp:7:
./../../include/mysql.hpp:20:25: note: previous declaration as ‘typedef struct st_mysql MYSQL’
typedef struct st_mysql MYSQL;
^~~~~
mysql.cpp: In constructor ‘litesql::MySQL::MySQL(const string&)’:
mysql.cpp:83:5: error: ‘Split’ was not declared in this scope
Split params(connInfo,";");
^~~~~
mysql.cpp:86:28: error: ‘params’ was not declared in this scope
for (size_t i = 0; i < params.size(); i++) {
^~~~~~
mysql.cpp:87:14: error: expected ‘;’ before ‘param’
Split param(params[i], "=");
^~~~~~
;
mysql.cpp:88:13: error: ‘param’ was not declared in this scope
if (param.size() == 1)
^~~~~
mysql.cpp:90:13: error: ‘param’ was not declared in this scope
if (param[0] == "host")
^~~~~
mysql.cpp:101:16: error: invalid use of incomplete type ‘MYSQL’ {aka ‘struct st_mysql’}
conn = new MYSQL;
^~~~~
In file included from mysql.cpp:7:
./../../include/mysql.hpp:20:16: note: forward declaration of ‘MYSQL’ {aka ‘struct st_mysql’}
typedef struct st_mysql MYSQL;
^~~~~~~~
mysql.cpp: In destructor ‘virtual litesql::MySQL::~MySQL()’:
mysql.cpp:111:12: warning: possible problem detected in invocation of delete operator: [-Wdelete-incomplete]
delete conn;
^~~~
mysql.cpp:111:12: warning: invalid use of incomplete type ‘struct st_mysql’
In file included from mysql.cpp:7:
./../../include/mysql.hpp:20:16: note: forward declaration of ‘struct st_mysql’
typedef struct st_mysql MYSQL;
^~~~~~~~
mysql.cpp:111:12: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined
delete conn;

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.