v
v copied to clipboard
sqlite: Functions thats returns the values resulting from a 'SELECT' query and name of column - Feature ISSUE #20565
This pull request addresses the feature mentioned in issue #20565 and implements a function that returns the values resulting from a 'SELECT' query and the name of each column. If an alias is provided either through the 'as' command or not, the returned value becomes the alias.
'SELECT SYNTAX' - Documentation 'JOIN SYNTAX' - Documentation
Examples:
All fields
r := db.get_queryset('SELECT * FROM repository')!
All names with explicit names
r := db.get_queryset('SELECT name, id FROM repository')!
All fields with alias
r := db.get_queryset('SELECT name as n, id i FROM repository')!
Specific field
r := db.get_queryset('SELECT name FROM repository')!
Specific field with alias and 'as'
r := db.get_queryset('SELECT name as n FROM repository')!
Specific field with alias without 'as'
r := db.get_queryset('SELECT name n FROM repository')!