Skip to content

Selecting string literals in PostgREST query #5205

Description

@taimoorzaeem

Background

Someone reached out to me privately to ask this. I am opening this for public discussion.

Problem

They said:

I just a have a quick question that has probably been mentioned in the docs but
for the life in me I cannot find it.

How do I deal with hardcoded values, like if I want to select something
from a table and then add a hardcoded value to it, in postgresql I would
do it as:

SELECT somecolumn, 'hardcodedvalue' as hardcodedname FROM sometable

where I would another column (or key as json) with the value of
'hardcodedvalue' and key hardcodedname.

I tried with something like this
sometable?select=somecolumn,hardcodedname:'hardcodedvalue' but that
obviously didnt work.

Activity

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

    docsOnly related to documentationquery-grammarextends the query grammar

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions