Code Monkey home page Code Monkey logo

yb-orm's People

Contributors

askobenkov avatar hlyustov-pm avatar ivaneko avatar ivanekom avatar kibeththewalker avatar lamsam avatar lobachevvaleriy avatar oganova avatar rwiths avatar sleepplease avatar teotwaki avatar vnaydionov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yb-orm's Issues

yb-orm and gcc v5

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?

Update Existing Domain Object

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?

Add proper aliasing for generated SQL queries

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'

Unable to declare BLOB members using YB_COL_DATA

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

Work with QT

Здравствуйте.
Не могу заставить работать вместе с Qt5.
Окружение: Ubuntu 14.04

  1. Сначала я собрал библиотеку
    ./configure --prefix=/home/user/Programizm/yb-orm-installed --with-test-db-url=sqlite+sqlite:///home/user/Programizm/yb-orm/test1_db.sqlite
    в Qt Creator создал тестовый проект, на кнопку повешал код из тут:

`
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;
}

}
`

Пример успешно собирается, запускается и работает (в БД появляются новые записи).

  1. После этого успешно собираю с поддержкой Qt (предварительно выполнив make clean):
    ./configure --prefix=/home/user/Programizm/yb-orm-installed --with-test-db-url=sqlite+qtsql:///home/user/Programizm/yb-orm/test1_db.sqlite --with-qt-includes=/usr/include/qt5 --with-qt-libs=/usr/lib/i386-linux-gnu

При сборке тестового проекта появляются сообщения undefined reference to `Yb::SqlConnection::SqlConnection(std::string const&)' и много других из пространства имен Yb::

Подскажите, что можно сделать?
Может надо передавать подключения из Qt? В документации примеров с Qt не нашел.

Возможно одновременное подключение средствами QtSql и библиотекой YB ORM (собранной без поддержки Qt) к БД Sqlite?

From lamsam@: is there a way to check for an empty master object?

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);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.