BUG Fix lifetime of DB store and ANSI SQL compatible syntax