YB.ORM / News: Recent posts

YB.ORM-0.4.8 released

* Fix broken DomainObj::find(); Fix warnings
* Fix broken method Property::is_null(); More checks not to dereference NULL pointer
* Fix possible buffer underrun
* Sync micro_http with card-proxy
* Fix problem with removing of non existent backup file 
* #28: fixing defects found by Coverity Scan
* #26: do not throw on saving a DataObject twice;
* check if logger is present in EngineBase
* #25: fixes for msvc
* Fix resource exhaustion handling in main loop of micro_http listener.
* #25: apply aliases for generated SELECT statements
* #25: generate short mnemonic aliases for tables
* Move the interlocked connection opening logic from drivers to SqlPool,
  make it optional 
* #24: do not use placement new/direct destructor calls: gcc5.2.1 bug? 
* Improve performance of operations with keys: optimized for int IDs
* micro_http: Support setting back log size on a listening socket
* Adjust logger format
* Simplify logic of SqlPool
* Logger: get/set/check the log level
* ElementTree: easy access attributes with @ prefix
* Update micro_http server and TcpSocket wrapper class
* important: start a transaction on first select if explicit transaction
  is required;
* pool: reopen a DB connection when got a DB error and no activity seen yet
  on the connection;
* micro_http: added HttpHeaders class implementation in Auth example;
* micro_http: analyze Content-Type more correctly;
* micro_http: allow to set response body with no additional headers.
* Fix XInclude processing for LibXML2
* fix broken object construction for explicit joins;
* rename class ObjectList -> DataObjectList
* added test for explicit joins
* do not thow from destructor even if a connection fails to rollback
Posted by Vaclav Naydionov 2016-04-11

YB.ORM-0.4.7 released

* New SQL dialect supported: MSSQL. Tested on Linux (TDS)
  and Windows (Native Client 10).
* Explicit .select_from<>() and .join<>() modifiers for QueryObj.
* yborm_gen can be used to manually create schema objects
  in database (--populate-schema) as well as to drop them
  (--drop-schema) in a correct order.
* yborm_gen tools can help to extract database schema
  and store it into XML format (--extract-schema),
  there are still limited support for type mapping.
* New layout for SqlDialect descendant classes.
* Proper support for 'LIKE' and 'IN' operators.
* Fix comparison of Property instances.
* Make use of std::tuple if it's available (GCC >= 4.6, MSVC >= 2013).
* CMake: build-system fixes to allow easy selection of Boost instance.
* Windows: move third party components (Boost, CppUnit, LibXML2, SQLite)
  into separate folders, pack up prebuilt third party libraries
  for certain versions of MSVC and MinGW.
* Allow to compile in SQLite3 sources into YB.ORM dll.
* Fix Automake/CMake scripts to support building YB.ORM with Qt5
  on Linux and Windows.
* Auth example: Fix possible endless loop in HTTP code.
Posted by Vaclav Naydionov 2015-04-21

YB.ORM-0.4.6 released

* New optional inline syntax for describing the mapping scheme
  within a class declaration, based on macros.
* Porting tut2 and tut4 examples to the new declaration syntax
  instead of using XML configs.
* Support .range() pager in queries for different SQL dialects,
  also add .first() filter based on that pager.
* Updated documantation.
* Simple constructor for Session that accepts the connection string.
* It's possible now to construct the Session with a native connection,
  for example soci::session.
* Logger can be set in Session, no need to explicitly create Engine
  object, in simple cases.
* Schema object can export its current configuration to XML or SQL.
* New options object for SQL generation procedure.
* Many fixes to the build scripts.
* Auth example: Fix TcpSocket::read*() to use select() and a buffer.
Posted by Vaclav Naydionov 2014-10-22

YB.ORM-0.4.5 released

* New source tree layout: separate includes from sources,
  separate public includes from private ones,
  the file names are now in lowercase, 
  put tutorial in the examples directory.
* Tested to build on Windows 8 with MS Visual Studio 2013
  and with Boost 1.53.
* Enable building dynamic libraries (.dll) on Windows.
  This option now is used by default.
  You can still turn on static linking in
  src/util/CMakeLists.txt and src/orm/CMakeLists.txt.
* Fixed Autoconf/Automake scripts to build on Ubuntu 14.04,
  as well as on FreeBSD 10, Cygwin.
* Use third party boost.m4 to detect Boost at ./configure stage.
* Added stuff to make Debian packages.
  Tested on Ubuntu 12.04.
* Many little API improvements:
  proper handling of for_update flag, etc.
* Basic means to create indices from schema.
* Updated tutorials.
* Auth example: refactor micro_http server.
Posted by Vaclav Naydionov 2014-07-17

YB.ORM-0.4.0 released

* New SQL driver for SOCI library (http://soci.sourceforge.net/).
  If you build with SOCI then you can use connection URL like this:
  "mysql+soci://user=test1 pass=test1_pwd host=localhost service=test1_db" -
  this example shows usage of native MySQL driver, and the following
  one shows usage of ODBC through SOCI -
* Support for floating point numeric types (Value::FLOAT),
  i.e. float and double in C++.
* Did some profiling and made significant improvements in speed,
  in particular: fixed input parameter binding; removed excessive use
  of shared pointers, replaced them with intrusive pointers, especially
  where thread-safety makes no sense; now the variant type Yb::Value
  is optimized to make fewer memory allocations.
* Pre-built packages for Windows now make use of single
  configuration file bin\yborm_env.bat, this is the place to set PATH
  environment variable and to specify the connection string for
  the test database.
* Auth sample: TcpSocket::accept() now can return source address of
  incoming connection; fixed exception handing in micro_http.cpp.
* Tested with Borland C++ Builder 6: kind of works.
  Yes, the compiler is an old piece of crap, I know.
* NOTE: there is a new field named 'D' in test table 'T_ORM_TEST',
  so you may encounter problems in case you run tests on existing table,
  things can be altered like this (example shown for MySQL):
  mysql> alter table T_ORM_TEST add (D double precision);
* Updated docs, see "doc" directory.
Posted by Vaclav Naydionov 2013-06-18

YB.ORM-0.3.4 released

* Implement order-by relationship property.
* Implement use-list='false' relationship property: useful for one-to-one relation.
* Add Engine::create_schema(), Engine::drop_schema().
* Basic JSON serializer from ElementTree.
* Optimize DataObject and RelationObject structures algorithmically.
* CodeGen: move Holder typedef into domain class.
* Fix domain object comparison, allowing to put them in maps and sets.
* Fix to allow actually use tables without a surrogate key
  and tables with a manually assigned surrogate key.
* Fixes for better support of tables with compound keys.
* Fix flushing of new keyed DataObjects.
* Bunch of fixed typos.
Posted by Vaclav Naydionov 2013-01-31

YB.ORM-0.3.3 released

* Add tut4.cpp: tree structure stored in a table. Fixes to make it work.
* Fixes to build under MacOSX.
* Refactor Engine classes hierarchy.
* Refactor methods Engine::insert(), Engine::update(), Engine::delete().
* Implement OrderedDict class template.
* Fix finding tables and columns by name, improve speed.
* Set FK value on linking of two objects if posible.
* Add distinct and for update flags to SelectExpr.
* Extended logging for delete_object() operation.
* DDL statements generated from Schema are now iterable.
* Rename class Filter -> Expression.
* Rename some files to follow common style and to better reflect their contents.
* Fix per request from nbuyvich: chained property references.
* Fix delete_object() to behave properly when deleting a row from a link-table (n-to-n relation).
* Fix yborm_gen: default value setter.
* Fix per request from nbuyvich: Make it work: pg1->parent->id.is_null()
Posted by Vaclav Naydionov 2013-01-02

YB.ORM-0.3.2 released

* New more intuitive syntax for filters in queries:
it's done via operator overloading.
* Domain classes now have static variable 'c' for convenient
metadata referencing, useful e.g. for filtering.
* When querying a tuple of Domain classes there will be issued
a query with join of corresponding tables.
* Query object now has got methods .one() and .count()
in addition to old method .all().
* Added Tutorial3: Querying objects.
* Fix subtle bug with compiler reordering function calls that leads to
wrong parameter orders.
* Fix assertion with re-adding object into session.
* Fix: Session must always do rollback on releasing Engine.
* Auth sample: Improve App class, use theApp::instance().new_session()
for creating sessions.

Posted by Vaclav Naydionov 2012-10-01

YB.ORM-0.3.1 released

* Integrate native SQLITE driver for use in non-QT builds.
Now this driver is used in Windows examples by default.
Thanx to Andrey Skobenkov.
* Improved logging in the ORM core.
* Support URL for specifying connection thruout the examples
and the build system.
Now it's possible to just use --with-test-db-url option
and YBORM_URL environment variable.
* Applied patches from Sebastian Lauwers,
See closed tasks here: http://code.google.com/p/yb-orm/issues
* Fixed Session::flush_delete(): respect the depth.
* Fixed Engine::on_delete(): once prepare, many times exec.
* Cleaned up MetaData classes' interfaces for sake of convenience.
Now the generated code looks more readable.
* New class Expression replaced old Filter class.
This is the first step to develop a comprehensive query language.
* For convenience added --with-yborm-root to configure script
in Auth sample.
* Application singleton for Auth example.

Posted by Vaclav Naydionov 2012-08-24

YB.ORM-0.3.0 released

* New and more convenient method of access to domain object properties:
via property-proxy accessors, instead of old setters/getters.
The generated domain class code becomes much cleaner.
Property accessors are implemented for simple data types,
as well as for object references and object collections.
To implement recurrent object references there is DomainHolder class.
Take a look at ProductGroup class from examples/ex2_schema.xml.
I.e. all object references are implemented using DomainHolder, and
therefore they must be dereferenced using arrow (->), not just dot (.).
This change breaks the backward compatibility of the generated code.
* The code generator utility itself is named yborm_gen now and
and is able to produce C++ domain classes as well as SQL DDL statements.
No more need for xsltproc tool. See tutorial1 for example.
Also, internally the code generator has moved to libyborm.
* Initial support for SQLite3 dialect, via QtSql driver.
* Construct SqlSource from URL, using simple URL parser.
See examples in CHANGES file.
You can pass single environment variable YBORM_URL to Engine instance,
instead of combination of YBORM_DBTYPE, YBORM_DRIVER, YBORM_DB,
YBORM_USER, YBORM_PASSWD environment variables. This is mostly
useful for testing.

Posted by Vaclav Naydionov 2012-07-16

YB.ORM-0.2.5 released

The Big Change: now you can build YB.ORM against wxWidgets or QT, and use their native data structures. Boost and LibXml are not required. Look at the "configure" script options, please.
On Windows cmake script is capable of building with QT from Nokia QT SDK.
QT build utilizes native QtSqlDriver instead of OdbcDriver.
query<>() function now accepts tuples of Domain classes (boost::tuple), useful for joining tables.
New method Session::commit() = Session::flush() + Engine::commit().
Better support for compound foreign keys.
Better diagnostics when yborm_gen_domain checks schema structure.
Now the only thread that opens and closes all connections when using SqlPool is the monitor thread.
Propagate exceptions back from the monitor thread in SqlPool to report about 'failed to connect' conditions immediately.
Rename SqlConnect -> SqlConnection.
Introduce SqlCursor: an SqlConnection now may have more than one open SqlCursor (and SqlResultSet).
Fix Auth example: Fix micro HTTP server in case the client connection is closed unexpectedly. Support POST queries, other than application/x-www-form-urlencoded.

Posted by Vaclav Naydionov 2012-06-28

YB.ORM-0.2.4 released

Added SqlPool for database connection pooling, thanx to Nikita Buyvich.
ResultSet is now able to cache all rows, i.e. it is not necessary lazy.
Support for two or more distinct relations on the same table using different foreign keys.
Added support for 32bit integer SQL data type in schema.
Build script for CMake and MinGW.
Support for Postgres SQL dialect.
Auth example: Allow to register the first user when users table is empty just by visiting special link, like this:
Bugs fixed:
Fixed a long lasted bug with misuse of ODBC function SQLBindParameter.

Posted by Vaclav Naydionov 2012-04-06

YB.ORM-0.2.3 released

Added a simple logger implementation.
Reimplemented xml Writer classes from scratch (no need to use libxml2).
Replaced Xml::Node with more convenient class ElementTree::Element,
still depending on libxml2, but not exposing any of its internals.
Auth is a separate demo project contributed by Nikita Buyvich,
the demo is a minimal HTTP server, which implements a toy auth
ptotocol using XML. Look in examples/auth.
Many bugfixes.
As always, the prebuilt version for MSVC2010 is available.

Posted by Vaclav Naydionov 2012-03-03

YB.ORM-0.2.2 released

Build in schema pieces into generated classes.
Update of autogenerated code now works (AUTOGEN sections only).
Use smart pointers for Tables and Relations metadata objects.
Automatic registration of domain classes at DomainFactory singleton.
Wide Unicode partial support.
Start to work on a tutorial.
Bugs fixed:
- TestDataObject::test_data_object_relink()
- TestDataObjectSaveLoad::test_flush_new_linked_to_existing()
- TestDataObjectSaveLoad::test_lazy_load_fail()
Prebuilt version for MSVC2010 available

Posted by Vaclav Naydionov 2011-12-19

YB.ORM-0.2.1 released

Implement load_collection() using DataObjectResultSet with iterator.
Three levels of lazy result sets: SqlResultSet, DataObjectResultSet and
DomainObjectResultSet template class.
Row becomes a vector of named values.
Diffenetiate Session.save() and save_or_update().
Prebuilt version for MSVC2010

Posted by Vaclav Naydionov 2011-10-19

Pre-built library and tools for Windows

I know, building YB.ORM and friends from scratch is a headacke. So here are two prebuilt packages for two different Windows-hosted C++ compilers. Have less trouble trying out YB.ORM :)

Posted by Vaclav Naydionov 2011-10-13

YB.ORM-0.2.0 released

The Big Change: new internal weak-typed row representation DataObject class
replaces old RowData class. Session class has been also rewritten from scratch.
This solves old big problems with how object relations are represented and
who shall be responsible for holding object reference.
Now deletion (including cascading) works for objects and relations.
Take a look at new tests at lib/orm/test/TestDataObject.cpp

Posted by Vaclav Naydionov 2011-10-10