使用 DataGrip 在本地运行 Supabase,“关系“public.users”不存在”

san*_*ets 6 postgresql datagrip supabase

我在 MacOS 上使用 Docker 在本地运行 Supabase。我使用 Supabase 初始化了 Next.js 项目,并将本地创建的数据库连接到 JetBrains DataGrip。我可以毫无问题地查看和调整 DataGrip 中的数据。但是当我尝试从应用程序的 API 查询数据时,出现错误'relation "public.users" does not exist'

但是,users我的表位于公共模式内。所以当我尝试使用 API 访问它时,我不太确定为什么它不存在。

在DataGrip中,我的数据库文件结构是:

postgres@localhost > postgres > schemas > public > tables > users
Run Code Online (Sandbox Code Playgroud)

我的应用程序使用 Supabase 客户端进行连接:

postgres@localhost > postgres > schemas > public > tables > users
Run Code Online (Sandbox Code Playgroud)

我用来访问数据的 API 调用是:

import { createClient } from '@supabase/supabase-js'

const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL
const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY

export const supabase = createClient(supabaseUrl, supabaseAnonKey)
Run Code Online (Sandbox Code Playgroud)

为了防止与托管 Supabase 数据库使用的用户表发生某种命名冲突,我也对表进行了上述操作accounts,但这没有任何影响。