Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c++

orm

odb

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?

like image 243
hossein hashemian Avatar asked Oct 08 '12 05:10

hossein hashemian


People also ask

What is ODB in SQL?

Database. Operational Database (ODB)

What is the standard query language for ODB?

ODB/SQL is a language to manage ODB observational databases. It is a minimum subset of international standard SQL (Structured Query Language) used to manipulate genuine relational databases.

What is ORM 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.


2 Answers

I don't think so. Looking at the main page of the project, there is an example how to use ODB. It seem that you need only add some pragmas here and there:

#pragma db object
class person
{
  ...
private:
  friend class odb::access;
  person () {}

  #pragma db id
  string email_;

  string name_;
  unsigned short age_;
};

but you do that on already present code, so no, it does not generate anything.

like image 182
Lyubomir Vasilev Avatar answered Sep 22 '22 23:09

Lyubomir Vasilev


the QxORM maybe help you to this work. this library use for Qt framework.

like image 27
hassan deldar Avatar answered Sep 22 '22 23:09

hassan deldar