graphjin icon indicating copy to clipboard operation
graphjin copied to clipboard

Columns marked with citext are considered tables

Open KoduIsGreat opened this issue 3 years ago • 0 comments

What version of GraphJin are you using? graphjin version

v0.16.101

Have you tried reproducing the issue with the latest release?

no

What is the hardware spec (RAM, OS)?

Windows 10 64bit 16GB RAM

Steps to reproduce the issue (config used to run GraphJin).

I am running graphjin with the following go code

package main

import (
	"github.com/dosco/graphjin/serv"
	"log"
)

func main() {
	conf := &serv.Config{}
	conf.AppName = "TestApp"
	conf.WebUI = true
	conf.DB.Host = "127.0.0.1"
	conf.DB.Port = 5432
	conf.DB.Schema ="esp"
	conf.DB.DBName = "esp"
	conf.DB.User = "esp"
	conf.DB.Password = "esp"
	gjs, err := serv.NewGraphJinService(conf)
	if err != nil {
		log.Fatal(err)
	}

	if err := gjs.Start(); err != nil {
		log.Fatal(err)
	}
}

against a db that looks like the following here were enabling the case insensitive extension.

-- application users
create extension citext;
create table users (
    id uuid default gen_random_uuid() primary key not null,
    email citext unique not null,
    first_name text not null,
    last_name text not null,
    phone_number text not null,
    position text,
    department text,
);

In the webui this is what the users graphql email schema looks like

image

Expected behaviour and actual result.

citext is just case insensitive text, so i would expect it to treat the column as just a string in the graphql schema

KoduIsGreat avatar Sep 20 '21 15:09 KoduIsGreat