Can ORM ODB for C++ generate code from a database
Asked Answered
M

2

7

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?

Maggard answered 8/10, 2012 at 5:38 Comment(1)
I created php script to create classes from MySQL tables, check it hereChristoforo
M
2

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.

Misapprehension answered 8/10, 2012 at 5:43 Comment(2)
so what this means in the help of the odb, in windows: "--database | -d (db) Generate code for the database (db)"Maggard
that means you are generating the code between c++ and the dbChristoforo
C
2

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

Clerissa answered 9/10, 2012 at 6:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.