vnaydionov / yb-orm Goto Github PK
View Code? Open in Web Editor NEWYB.ORM is an object-relational mapper for C++
License: Other
YB.ORM is an object-relational mapper for C++
License: Other
after upgrading to ubuntu 15.10 I cannot configure build with default settings. After hours of research I found article Porting to GCC 5 and see that preprocessor default behaviour was changed. After I used -P flag for preprocessor build was made successfully! So can you update your build scripts to undestand new GCC v5?
Hi!
Your wiki documentation says, that I can:
modify existing objects by just assignment to objects' fields;
But if I do:
Client client(session, id);
client.name = new_name;
client.save(session);
session.commit();
I get DataObject is already registered in the identity map: Key('clients', {'id': 1})
What I'm doing wrong and what is the propper way to update object?
Some databases like MySQL require explicit aliasing in subqueries. For this reason one of the test is still breaks when running on MySQL
15-11-16 12:43:27,792 P31124 T31124 INF engine.sql: prepare: SELECT COUNT(*) CNT FROM (SELECT
T_ORM_TEST.ID, T_ORM_TEST.A, T_ORM_TEST.B, T_ORM_TEST.C, T_ORM_TEST.D,
T_ORM_XML.ID, T_ORM_XML.ORM_TEST_ID, T_ORM_XML.B
FROM T_ORM_TEST JOIN T_ORM_XML ON (T_ORM_TEST.ID = T_ORM_XML.ORM_TEST_ID)) X
15-11-16 12:43:27,792 P31124 T31124 DBG engine.sql: exec prepared:
15-11-16 12:43:27,801 P31124 T31124 WRN engine.sql: mark connection bad, because of 42S21:
[MySQL][ODBC 5.1 Driver][mysqld-5.5.43-0ubuntu0.12.04.1]Duplicate column name 'ID'
it would be great to have this task automated, although the output
may still need further editing most of time.
Hi,
Using visual c++ I get compilation errors when I try to use BLOB as a column type. For example
YB_COL_DATA(picture_LowRes, "Picture_LowRes", BLOB)
The error is "YB_CPP_TYPE_BLOB" is undefined
Здравствуйте.
Не могу заставить работать вместе с Qt5.
Окружение: Ubuntu 14.04
`
void MainWindow::on_pushButton_clicked()
{
try {
std::auto_ptrYb::SqlConnection conn(new Yb::SqlConnection(
"sqlite+sqlite://./test.db"));
Yb::Engine engine(Yb::Engine::READ_WRITE, conn);
Yb::init_schema();
Yb::Session session(Yb::theSchema(), &engine);
Domain::Client client;
std::string name, email, budget;
std::cout << "Enter name, email, budget:\n";
name="name";
email="e-mail";
budget="1024";
client.name = name;
client.email = email;
client.budget = Yb::Decimal(budget);
client.dt = Yb::now();
client.save(session);
session.flush();
std::cout << "New client: " << client.id.value() << std::endl;
engine.commit();
}
catch (const std::exception &ex) {
std::cerr << "exception: " << ex.what() << std::endl;
}
}
`
Пример успешно собирается, запускается и работает (в БД появляются новые записи).
При сборке тестового проекта появляются сообщения undefined reference to `Yb::SqlConnection::SqlConnection(std::string const&)' и много других из пространства имен Yb::
Подскажите, что можно сделать?
Может надо передавать подключения из Qt? В документации примеров с Qt не нашел.
Возможно одновременное подключение средствами QtSql и библиотекой YB ORM (собранной без поддержки Qt) к БД Sqlite?
It may not be hard to do, but some fixes will be certainly needed
I.e. when there is a NULL
foreign key pointing from slave to master?
Yes, now there is one way:
obj.master_obj->is_empty()
and the less elegant:
obj.get("MASTER_ID").is_null()
Btw. SomeDomainClass::Holder
objects are always not empty,
since each of them contains an instance of corresponding SomeDomainClass
class.
So, if you have to return an instance of SomeDomainClass, that may become empty,
just construct your "empty" instance like this:
return SomeDomainClass(EMPTY_DATAOBJ);
Modern C++ features are becoming widely used.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.