Questions tagged [odb]

ODB is an open-source, cross-platform, and cross-database object-relational mapping (ORM) system for C++.

ODB is an open-source, cross-platform, and cross-database object-relational mapping (ORM) system for C++. It allows you to persist C++ objects to a relational database without having to deal with tables, columns, or SQL and without manually writing any mapping code. ODB supports MySQL, SQLite, PostgreSQL, Oracle, and Microsoft SQL Server relational databases as well as C++98/03 and C++11 language standards. It also comes with optional profiles for Boost and Qt which allow you to seamlessly use value types, containers, and smart pointers from these libraries in your persistent C++ classes.

82 questions
7
votes
2 answers

Can ORM ODB for C++ generate code from a database

I am fairly new to this library, and ORM in general. I know tools like EntityFramework can generate code from a database. Can ODB for C++ do this work?
5
votes
1 answer

Visual Studio custom build event always executing

I am using the odb compiler as a custom build tool. The build tool is always executing even though the input file is not changing. The command line: odb -Ic:\menuplan\src\ingredient -o c:\menuplan\src\ingredient -d mysql --hxx-prologue…
Thomas Matthews
  • 56,849
  • 17
  • 98
  • 154
4
votes
0 answers

How to Build ODB on Mac OS X 10.11

I am trying to build ODB on El Capitan. I am confused about the versions of xcode as they pertain to clang. Looking at ODB's 2.4.0 announcement shows the following information: Platform Compiler Version C++ Std Arch Qt Boost…
hofan41
  • 1,438
  • 1
  • 11
  • 25
4
votes
1 answer

Moving odb pragmas outside class header

Is way to move odb (c++ orm like framework) pragmas outside class header? For example I define class basic_object (abstract) with id only: class basic_object { int _id; public: int get_id() const; void set_id(int _id); }; And then…
Dcow
  • 1,413
  • 1
  • 19
  • 42
3
votes
0 answers

Performance difference in C++ on Mac and Linux (Slower on Linux than Mac)

I have an API written in C++, I'm using Xcode IDE for development, and using Silicon Framework as the web framework and ODB as the ORM to connect to MySQL (read and write) and SQLite (read only) databases. I compile the API using CMake and GNU…
3
votes
1 answer

Extract nodal coordinates from the deformed testsubject (abaqus-python)

I am trying to make a python script to extract the nodal coordinates from the ODB file (from abaqus). So far i have come up with the code attached below (don't mind the extra information i put behind the #, sometimes it's just so i can keep track of…
Theodoor
  • 77
  • 1
  • 7
3
votes
0 answers

How to log the parameters sent to database via odb?

I understand that queries can be logged via odb::tracer. The output looks something like this: INSERT INTO "event" ("id", "date","seq") VALUES ($1, $2, $3) How about the parameters' values?, i.e. how to see the actual values of $1, $2, $3 in the…
doraemon
  • 403
  • 6
  • 15
3
votes
1 answer

Abaqus python scripting - Element set created in .mdb not accessible in .odb

I've created a Set of elements in the rootAssembly in an .mdb file: a = mdb.models['Model-1'].rootAssembly els_1 = a.instances['Part-1'].elements Coh_els = els_1.getByBoundingBox(x1 y1 z1 x2 y2 z2) a.Set(elements=Coh_els, name='COHELSET-0') I'm…
Masha
  • 41
  • 1
  • 3
3
votes
1 answer

Trying to get simple ODB 'hello' program to work

Working with VS 2012 and Microsoft SQL Server. I got everything to compile and build, but the program dies when I try to persist the first object: // file : hello/driver.cxx // copyright : not copyrighted - public domain #include //…
Jiminion
  • 5,080
  • 1
  • 31
  • 54
2
votes
1 answer

C++ ODB database mapper: Unable to use std::weak_ptr in relationship

I'm trying to model a one-to-many relationship with ODB. I'm basically trying to recreate the example in https://www.codesynthesis.com/products/odb/doc/manual.xhtml#6.2.2 I have to use std::weak_ptr for one side of the relationship, to avoid…
Lukas Barth
  • 2,734
  • 18
  • 43
2
votes
0 answers

ODB ORM SQLite database migration

I've read ODB manual ch. 13 and now I try to migrate my database version. I use sample from the end of chapter 13.2: schema_version v (db.schema_version ()); schema_version bv (schema_catalog::base_version (db)); schema_version cv…
Alex
  • 617
  • 4
  • 15
2
votes
1 answer

ODB C++ - Unknown database schema error

In my Visual Studio solution, I have two different projects of which one is built as a static libraryand the other one as the executable. The ODB related code like creating the database and all are in the library. I linked this library to my…
Jackzz
  • 1,417
  • 4
  • 24
  • 53
2
votes
1 answer

Where is the sqlite database file stored in ODB C++ Example

I am using ODB: C++ Object-Relational Mapping (ORM) from Code Synthesis for the very first time. This is a tool that seems akin to .NET EntityFramework for C# in that it allows you to perform create, read, update, and delete (CRUD) operations on a…
RudyD
  • 87
  • 1
  • 10
2
votes
4 answers

Trying to use -I option with g++

I am trying to compile a source file driver.cxx and among its include files is a library called The path to this file is /home/terry/Downloads/libodb-2-4-0/odb/sqlite/database.hxx to compile it I enter the following: g++ -c driver.cxx…
Teererai Marange
  • 2,044
  • 4
  • 32
  • 50
2
votes
0 answers

building problems with odb in QtCreator

I want to make a sql application in QtCreator with the Qt libary and the ORM libary ODB but when i try to build the Hello example from the ODB site I only get a list of errors and I couldn't find out the problem. My ideas are that their are missing…
1
2 3 4 5 6