mirror of
https://github.com/supabase/supabase.git
synced 2026-05-24 20:58:45 +08:00
* Move all studio files from /studio to /apps/studio. * Move studio specific prettier ignores. * Fix the ui references from studio. * Fix the css imports. * Fix all package.json issues. * Fix the prettier setup for the studio app. * Add .turbo folder to prettierignore. * Fix the github workflows.
27 lines
671 B
TypeScript
27 lines
671 B
TypeScript
import { createClient } from '@supabase/supabase-js'
|
|
import { IS_PLATFORM } from '../constants'
|
|
|
|
let readOnly: any
|
|
|
|
if (IS_PLATFORM) {
|
|
readOnly = createClient(process.env.READ_ONLY_URL ?? '', process.env.READ_ONLY_API_KEY ?? '')
|
|
const readOnlyErrMessage = Error('This client is for read-only actions. Use readWrite instead.')
|
|
|
|
// overwrites function calls
|
|
// for readOnly
|
|
readOnly.from('').insert = () => {
|
|
throw readOnlyErrMessage
|
|
}
|
|
readOnly.from('').delete = () => {
|
|
throw readOnlyErrMessage
|
|
}
|
|
readOnly.from('').update = () => {
|
|
throw readOnlyErrMessage
|
|
}
|
|
readOnly.rpc = () => {
|
|
throw readOnlyErrMessage
|
|
}
|
|
}
|
|
|
|
export { readOnly }
|