[odb-users] Joining underscore for column pragma on composite values

Boris Kolpackov boris at codesynthesis.com
Tue Dec 6 11:03:40 EST 2016


Hi Dieter,

Dieter Govaerts <dieter.govaerts at bricsys.com> writes:

> Unfortunately there seems to be a bug in 2.4.0 because it only works
> for non-TEXT columns (SQLite).

I've adjusted your original example like this:

#include <string>

#pragma db value
struct name
{
  int first_;
  std::string last_;
};

#pragma db object
struct person
{
  #pragma db column("person$")
  name name_;

  #pragma db id
  int id;
};

Without your --column-regex I get:

CREATE TABLE "person" (
  "person$_first" INTEGER NOT NULL,
  "person$_last" TEXT NOT NULL,
  "id" INTEGER NOT NULL PRIMARY KEY);


And with --column-regex '/(.+)\$_(.+)/$1\$$2/':

CREATE TABLE "person" (
  "person$first" INTEGER NOT NULL,
  "person$last" TEXT NOT NULL,
  "id" INTEGER NOT NULL PRIMARY KEY);

So there must something else going on. If you can create a test that
reproduces the problem, I can take a look.

Boris



More information about the odb-users mailing list