summaryrefslogtreecommitdiffstats
path: root/pgcli/packages/pgliterals/main.py
blob: 5c39296d4750218db64dcc3928914fda56d50e48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import os
import json

root = os.path.dirname(__file__)
literal_file = os.path.join(root, "pgliterals.json")

with open(literal_file) as f:
    literals = json.load(f)


def get_literals(literal_type, type_=tuple):
    # Where `literal_type` is one of 'keywords', 'functions', 'datatypes',
    # returns a tuple of literal values of that type.

    return type_(literals[literal_type])