This Week in Starcounter – 16/06/2017

June 16, 2017 12:38 pm Published by Leave your thoughts

We’ve made two changes to the public API’s this week that are available from the Release Candidate version released tonight.

GlobalSQL

RunWithinApplication were in some cases used to query the database classes of other apps. Since RunWithingApplication is now obsolete, we have introduced a new way to accomplish this – Db.GlobalSQL.

Since it’s able to query all database classes, the full namespace of the classes have to be provided. For example:

string query = "SELECT p FROM MyApp.MyNamespace.MyClass p WHERE p.Property = ?";
var result = Db.GlobalSQL(query, "john")

DELETE is moved to Db.SQL

The DELETE statement used to only be available from Db.SlowSQL due to a limitation with large transactions. This limitation no longer exists, so it’s now also available in Db.SQL. There’s no difference in functionality or performance between DELETE in the two methods.

Now, Db.SlowSQL and Db.SQL are identical except that Db.SlowSQL supports literals which will never be added to Db.SQL because of their inherently poor performance.

In essence, Db.SlowSQL should never have to be used in application code anymore.

Categorised in: ,

This post was written by Erlend Landrö

Leave a Reply

Your email address will not be published. Required fields are marked *