question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Select result to Array of strings?

See original GitHub issue

Is it possible to do Select query and get result as list of Strings (i.e. to not map to object)? Like:

String query = "select columnName from table";            
List<String> result = DatabaseManager.Database.Query<???>(query);

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
praeclarumcommented, Aug 5, 2017

Selecting scalars is not supported, but would be a great feature.

1reaction
Deus-nsfcommented, Mar 18, 2019

My bad, I forgot what I was dealing with, I was trying to retrieve only the IDs with a custom object

    public class ColumnData
    {
        public String Id;
    }

but the object needs to be formatted in the SQLite.net standard, which is :

    public class ColumnData
    {
        [PrimaryKey]
        public String Id { get; set; }
    }

and now it works fine 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Convert SQL Query result into array of strings - java
If I make the SQL query SELECT name, pass FROM loginTable WHERE name='%s'; is there a function to Return OR Convert the name...
Read more >
Select query to convert to array of string - SQL++
@vsr1 I have below select query that is resulting in array of objects. How can I retrieve/convert it into array of strings.
Read more >
Work with arrays | BigQuery
In GoogleSQL for BigQuery, an array is an ordered list consisting of zero or more values of the same data type. You can...
Read more >
Arrays and Lists in SQL Server (Short version)
Used as in the example above, it returns a result set with a single column value. Take this query: SELECT * FROM string_split...
Read more >
How to implement array-like functionality in SQL Server
SELECT value FROM STRING_SPLIT('Roberto,Gail,Dylan', ',');. The values will be converted to rows: In the STRING_SPLIT function, you need to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found