[odb-users] odb doesn't generate sql for sqlite

Jens Rapp rapp.jens at googlemail.com
Sun Dec 21 12:44:46 EST 2014


Hi,

just downloaded odb and installed it. I installed libodb-sqlite and 
libodb-mysql. compiling works for both but i didn't manage to build an 
sql file for sqlite.

Here's the class

/*
  * person.h
  *
  *  Created on: 21.12.2014
  *      Author: tecdroid
  */

#ifndef PERSON_H_
#define PERSON_H_

#include <odb/core.hxx>

#include <string>

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


     #pragma db id auto
     unsigned long id_;

     std::string name_;
     std::string vorname_;
     std::string kultur_;
     std::string profession_;

     unsigned long geburt_;

public:
     person (std::string name, std::string vorname, std::string kultur, 
unsigned long geburt);

     virtual ~person();
     unsigned long getGeburt() const;
     void setGeburt(unsigned long geburt);
     unsigned long getId() const;
     void setId(unsigned long id);
     const std::string& getKultur() const;
     void setKultur(const std::string& kultur);
     const std::string& getName() const;
     void setName(const std::string& name);
     const std::string& getProfession() const;
     void setProfession(const std::string& profession);
     const std::string& getVorname() const;
     void setVorname(const std::string& vorname);
};

#endif /* PERSON_H_ */


Working command is
odb -x "-std=c++11" -d mysql  --generate-schema  person.h
not working command is
odb -x "-std=c++11" -d sqlite  --generate-schema  person.h

my actual workaround would be to generate schema for mysql first and 
alter this.. after, I'll have to re-generate the code..

Is there any way to repair this?



More information about the odb-users mailing list