Skip to content

Does npgsql currently support VALUES Lists ? #2511

Closed

Activity

  1. changed the title [-]Does npgsql current support VALUES Lists[/-] [+]Does npgsql currently support VALUES Lists ?[/+] on Jul 2, 2019
  2. roji commented on Jul 2, 2019

    @roji
    Member

    Yes, but it ultimately depends on exactly what you want to do with them. Npgsql just sends your SQL (and parameters) to PostgreSQL and provides the results, so it doesn't need to "support" any specific feature. Can you please provide more info on what you're looking to do?

  3. dingsongjie commented on Jul 2, 2019

    @dingsongjie
    Author

    Yes, but it ultimately depends on exactly what you want to do with them. Npgsql just sends your SQL (and parameters) to PostgreSQL and provides the results, so it doesn't need to "support" any specific feature. Can you please provide more info on what you're looking to do?

    Because some of the query conditions come from the drop-down box, the amount of data selected in the drop-down box may be large, I would insert them to a temp table for good performence . I want use VALUES Lists instead of a temporary table.

  4. roji commented on Jul 2, 2019

    @roji
    Member

    I have no idea what drop-down box is used in your application, or how it related to VALUES or temporary tables... You will need to provide a clear description of what you want Npgsql to do here, can you provide a small code sample to illustrate?

  5. dingsongjie commented on Jul 3, 2019

    @dingsongjie
    Author

    I have no idea what drop-down box is used in your application, or how it related to VALUES or temporary tables... You will need to provide a clear description of what you want Npgsql to do here, can you provide a small code sample to illustrate?

    Some script like

    SELECT * FROM Users WHERE ID IN (VALUES (1), (2), (3))  
    
    SELECT * FROM (VALUES (1, 'one'), (2, 'two'), (3, 'three')) AS t (num,letter) 
    

    You may need to take a look at this document.

  6. YohDeadfall commented on Jul 3, 2019

    @YohDeadfall
    Contributor

    It's a const table expression and it's a part of SQL. The driver has nothing to do with it and doesn't alter any query you wrote. It just transfers data and command to the backend and reads responses.

    If you want to provide a list of tuples you can use an array of composite types and the unnest function in the query.

    Closing as it's not a Npgsql responsibility, but feel free to keep asking questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions