lxd/db/generate/db/stmt: Parse 'objects' directive result to create 'objects-by'
lxd/db/generate/db/stmt: Parse 'objects' directive result to create 'objects-by'

Updates statement generation for all statements of the type
'objects-by-FIELD' to first search the package for a variable
declaration of the form

var <entity>Objects = RegisterStmt(`SQL String`)

Which is produced from the 'objects' generation directive, and then
extract the SQL String from the syntax tree, and append a WHERE
clause with the given filters, and create a new variable declaration
of the form

var <entity>ObjectsByField = RegisterStmt(`SQL String with WHERE
clause`)

This will allow us to specify our own <entity>Objects for more
complex queries, and still be able to use lxd-generate to create
filterable statements.

Signed-off-by: Max Asnaashari <291db2cb5046c5ac435c5cc205a1b9bc80a27f4b@canonical.com>

lxc/lxd,lxc/lxd,stgraber/lxd,stgraber/lxd,stgraber/lxd,lxc/lxd,stgraber/lxd,lxc/lxd,stgraber/lxd,stgraber/lxd,lxc/lxd,lxc/lxd,lxc/lxd,stgraber/lxd