Choosing appropriate database’s segment size

Each Valentina’s volume consists of set of segments, even internal service-data placed in such segments.

Database storage is implemented similar to some file system. There are volumes (.vdb, .dat, .blb, .ind, .tmp) and there are some embedded files on that volumes (all the data like field-data, indexes and so on go to that files). Each volume operates with own segment map – so we can find (and allocate new) segments for particular embedded file easy and fast.

Continue reading Choosing appropriate database’s segment size

VREPORT.DLL now links to static Postgre client

We have start check installers to prepare 5.0 beta builds, and have note that on Windows, report.dll depends on pq.dll, which it its turns requires yet 8 dlls to be added into vcomponents folder.

We have decide that this is not good of course, and spent few days to resolve this. It was not simple, because of openSSL. Now we have resolve all that, so VREPORT.DLL on all 3 platforms, now contains SQLite, Postgre and mySQL clients linked directly into DLL.

Perfect 🙂

[NEW] ORDER BY in aggregative functions First()/Last()

SQL Standard allows to SELECT only fields mentioned in the GROUP BY and expressions based on aggregative functions. You cannot SELECT a normal field. But sometimes you may very want to do this. Question is what to do in this case.

In this new Valentina Wiki article, we have describe in detail this problem and gave THREE solutions. The third solution is new for v5.0 and it works x400/ x50 times faster of the first two correspondently in tests on the database of our customer.

The third solution, uses idea from ORACLE database actually: FIRST()/LAST() functions with own ORDER BY to be used inside of each group. It seems mySQL and PostgreSQL do not have any way to resolve this task in such effective way.

[NEW] Valentina Reports 5.0 Support mySQL Datasource

We are glad to inform you, that we already have working Valentina Reports engine with datasource from mySQL.

We have use one of BSD clients compatible with mySQL Server. This resolve any issues related with GPL-license of mySQL native drivers.

Please note, that this mySQL datasource for now works only for Valentina Reports ADK, but not in Valentina Studio – Report Editor. To prepare reports in the GUI Editor you need to use Valentina or Postgre or SQLite database with the same tables. But do not worry, in about 1.5-2 months we will introduce 5.x version of Valentina Studio, with full-featured mySQL plugin also.

Right now, you can make dump of schema of mySQL database, and load that dump into local Valentina DB, then use it as test-db to design report(s). Later, from ADK application, just specify mySQL datasource against this report(s). For mySQL you should use connection string of kind

theReport = my_project.MakeNewReport(
        "report_1",
        "mysql://host=192.168.2.33, user=admin, passw=admin",
        "SELECT fldName, fldPhone FROM tblPerson" )

[NEW] VClient now allows to control timeout using VConnection.ResponseTimeout

In 4.x version we did have VDatabase.ResponseTimeout for all ADKs, which in fact was not working. Now we have resolve this issue in the VClient.dll and move this property into VConnection class.

Problem was, that if VClient was in the state Read or Write  some command into socket, then on sudden loose of network connection VClient app did hang forever. We have redesign work with sockets for VClient.dll in the same way as it was in Valentina Server.

[NEW] Valentina 5.0 adds Sequences.

Postgre/Oracle users are used to use Sequences to generate values of Primary Key of tables. mySQL/Access users are used to use auto increment flag on a PK field for the same task. Generally speaking Sequences are more powerful and flexible, but more verbose.

We have add Sequences into Valentina 5.0 in 99% same way as they work in PostgreSQL, so now Valentina developer can choose between auto-increment and sequences if they develop true Relational model.

You can read details here:

Reminder: If developer uses modern ObjectPtr and Binary links of Valentina DB, then he can avoid PK-FK headache at all.

 

VStudio 5.0 Introduces Diagram Editing for Teams

Valentina Studio saves diagrams right into the database, even while working remotely with Valentina Server and PostgreSQL server. Since teams of developers can work on a server at the same time, how do you manage diagrams? Valentina 5 implements locks of diagrams and lock management through Valentina Studio.

For example, if user1 opens a diagram to edit. Then, user2 tries to open it. User2 will get the following dialog with the choice to open diagram in the read-only or exclusive mode.

VStudio 5.0 Shows Own Collator Properties in Bold

Valentina DB maybe the only database engine which gives you ability to specify collator properties of the  Database->Table->Field chain using inheritance.

For example, you can specify Collator.strength = kPrimary for Database object, and all its tables and their fields also will get the same value.

Even better. You can specify another value for some table or field, e.g. tblPersonFrench.Collator.strength = kSecondary, which overrides settings of parent object. If later you decide to change Database.Collator.strength to e.g. kTertiary, then all tables except tblPersonFrench inherit this new value. But tblPersonFrench will preserve  its own value kSecondary. And finally, you may want drop this own value of object to force it to use parent’s value.

From now (v5.0) Valentina Studio is able:

  • to display the fact that some property of collator of an object (database/table/field) has own value, in BOLD STYLE
  • to force an object to use parent settings using a contextual menu command
Below you can see some pictures that demonstrate this feature.

VStudio Pro 3 in 1 (ValentinaDB + PostgreSQL + SQLite) Data Editor

The following picture shows how you can use power of Valentina Studio Data Editor, to manage records of a Table without SQL.

You can add/delete/update records and values of fields. You can filter records applying filter.

You can even use Related Table Editor (bottom side) that displays records of related table (linked by Foreign Key). It is enough click record of the top table, and bottom table shows you related records.

Even more. You can just by mouse click link/unlink records. In background FK gets value of PK of parent record. But for you this looks as easy as mouse click.

Even more. You can apply set commands to find union/intersection or difference of sets of related records for few parent records. Couple of mouse clicks and you see result of quite complex SQL operation, which even SQL expert will write in few minutes only …

 

[NEW] VStudio Pro – SQL DIFF for Valentina, PostgreSQL and SQLite.

Valentina Studio Pro 5.0 going to get great new built-in feature: SQL Diff . This feature allows to open two databases and find difference between them and produce SQL script to resolve this difference.

Today our developer have plug all 3 databases (Valentina, PostgreSQL, SQLite) into SQL Diff and made tests. All 3 databases works as expected.

This is cool to have this feature right in the Valentina Studio, because then no need to purchase separate SQL Diff tools, which self might cost $100-400.

Below you can see few snapshots how looks SQL Diff wizard and SQL Diff Result page.

Continue reading [NEW] VStudio Pro – SQL DIFF for Valentina, PostgreSQL and SQLite.

New Docs About ENUM Type in v5.0

Today I added new reference pages to the wiki of e.g. SQL grammar about a new feature of Valentina DB for 5.0: the ENUM type.

This is the first step towards a CREATE TYPE command based on the SQL 2003 standard. Next we can add composite types, collection types and inheritance.

We think that Valentina can have a more effective and flexible ENUM implementation compared to PostgreSQL or mySQL. One example is that Valentina can use 1 byte to store an enum value, while mySQL – 2, PostgreSQL – 4.

We are finishing now integration of this feature into Valentina Studio for both Valentina DB and PostgreSQL plugins. Database types in Valentina Studio are supported through a plugin architecture.

These are major entry points in the Valentina Wiki to check:

VStudio:Report Editor – Now works with PostgreSQL as Datasource.

Valentina Studio Pro’s Report Editor now works using a PostgreSQL database specified as datasource! If have some Postgre database, connect to it and start design new report using data of that database. You can instantly preview your data right within Valentina Studio Pro. Reports are saved into a project format so you can reuse them at any time.

You can already use design reports this way from data from any Valentina DB ADK (REALbasic, Revolution, Cocoa, NET, PHP, … ). You can see few snapshots below.

Support for PostgreSQL will be included in Valentina Studio 5.0b1 – coming real soon. Valentina Reports will be able to work with local Valentina databases, Valentina Server hosted databases, local SQLite and now with PostgreSQL server.

Continue reading VStudio:Report Editor – Now works with PostgreSQL as Datasource.