Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Hides common filters using new underscore method

Paul Copplestone44bda5a9b247
diff --git a/web/docs/common/CommonFilters.js b/web/docs/common/CommonFilters.js
index b9946b2e3bb..2c37a0ae07c 100644
--- a/web/docs/common/CommonFilters.js
+++ b/web/docs/common/CommonFilters.js
@@ -1,27 +1,27 @@
import React from 'react'
-import Filter from './filters/filter.mdx'
-import Not from './filters/not.mdx'
-import Match from './filters/match.mdx'
-import Eq from './filters/eq.mdx'
-import Neq from './filters/neq.mdx'
-import Gt from './filters/gt.mdx'
-import Lt from './filters/lt.mdx'
-import Gte from './filters/gte.mdx'
-import Lte from './filters/lte.mdx'
-import Like from './filters/like.mdx'
-import Ilike from './filters/ilike.mdx'
-import Is from './filters/is.mdx'
-import In from './filters/in.mdx'
-import Cs from './filters/cs.mdx'
-import Cd from './filters/cd.mdx'
-import Ova from './filters/ova.mdx'
-import Ovr from './filters/ovr.mdx'
-import Sl from './filters/sl.mdx'
-import Sr from './filters/sr.mdx'
-import Nxl from './filters/nxl.mdx'
-import Nxr from './filters/nxr.mdx'
-import Adj from './filters/adj.mdx'
-import Or from './filters/or.mdx'
+import Filter from './filters/_filter.mdx'
+import Not from './filters/_not.mdx'
+import Match from './filters/_match.mdx'
+import Eq from './filters/_eq.mdx'
+import Neq from './filters/_neq.mdx'
+import Gt from './filters/_gt.mdx'
+import Lt from './filters/_lt.mdx'
+import Gte from './filters/_gte.mdx'
+import Lte from './filters/_lte.mdx'
+import Like from './filters/_like.mdx'
+import Ilike from './filters/_ilike.mdx'
+import Is from './filters/_is.mdx'
+import In from './filters/_in.mdx'
+import Cs from './filters/_cs.mdx'
+import Cd from './filters/_cd.mdx'
+import Ova from './filters/_ova.mdx'
+import Ovr from './filters/_ovr.mdx'
+import Sl from './filters/_sl.mdx'
+import Sr from './filters/_sr.mdx'
+import Nxl from './filters/_nxl.mdx'
+import Nxr from './filters/_nxr.mdx'
+import Adj from './filters/_adj.mdx'
+import Or from './filters/_or.mdx'
const filters = {
diff --git a/web/docs/common/filters/adj.mdx b/web/docs/common/filters/_adj.mdx
similarity index 100%
rename from web/docs/common/filters/adj.mdx
rename to web/docs/common/filters/_adj.mdx
diff --git a/web/docs/common/filters/cd.mdx b/web/docs/common/filters/_cd.mdx
similarity index 100%
rename from web/docs/common/filters/cd.mdx
rename to web/docs/common/filters/_cd.mdx
diff --git a/web/docs/common/filters/cs.mdx b/web/docs/common/filters/_cs.mdx
similarity index 100%
rename from web/docs/common/filters/cs.mdx
rename to web/docs/common/filters/_cs.mdx
diff --git a/web/docs/common/filters/eq.mdx b/web/docs/common/filters/_eq.mdx
similarity index 100%
rename from web/docs/common/filters/eq.mdx
rename to web/docs/common/filters/_eq.mdx
diff --git a/web/docs/common/filters/filter.mdx b/web/docs/common/filters/_filter.mdx
similarity index 100%
rename from web/docs/common/filters/filter.mdx
rename to web/docs/common/filters/_filter.mdx
diff --git a/web/docs/common/filters/gt.mdx b/web/docs/common/filters/_gt.mdx
similarity index 100%
rename from web/docs/common/filters/gt.mdx
rename to web/docs/common/filters/_gt.mdx
diff --git a/web/docs/common/filters/gte.mdx b/web/docs/common/filters/_gte.mdx
similarity index 100%
rename from web/docs/common/filters/gte.mdx
rename to web/docs/common/filters/_gte.mdx
diff --git a/web/docs/common/filters/ilike.mdx b/web/docs/common/filters/_ilike.mdx
similarity index 100%
rename from web/docs/common/filters/ilike.mdx
rename to web/docs/common/filters/_ilike.mdx
diff --git a/web/docs/common/filters/in.mdx b/web/docs/common/filters/_in.mdx
similarity index 100%
rename from web/docs/common/filters/in.mdx
rename to web/docs/common/filters/_in.mdx
diff --git a/web/docs/common/filters/is.mdx b/web/docs/common/filters/_is.mdx
similarity index 100%
rename from web/docs/common/filters/is.mdx
rename to web/docs/common/filters/_is.mdx
diff --git a/web/docs/common/filters/like.mdx b/web/docs/common/filters/_like.mdx
similarity index 100%
rename from web/docs/common/filters/like.mdx
rename to web/docs/common/filters/_like.mdx
diff --git a/web/docs/common/filters/lt.mdx b/web/docs/common/filters/_lt.mdx
similarity index 100%
rename from web/docs/common/filters/lt.mdx
rename to web/docs/common/filters/_lt.mdx
diff --git a/web/docs/common/filters/lte.mdx b/web/docs/common/filters/_lte.mdx
similarity index 100%
rename from web/docs/common/filters/lte.mdx
rename to web/docs/common/filters/_lte.mdx
diff --git a/web/docs/common/filters/match.mdx b/web/docs/common/filters/_match.mdx
similarity index 100%
rename from web/docs/common/filters/match.mdx
rename to web/docs/common/filters/_match.mdx
diff --git a/web/docs/common/filters/neq.mdx b/web/docs/common/filters/_neq.mdx
similarity index 100%
rename from web/docs/common/filters/neq.mdx
rename to web/docs/common/filters/_neq.mdx
diff --git a/web/docs/common/filters/not.mdx b/web/docs/common/filters/_not.mdx
similarity index 100%
rename from web/docs/common/filters/not.mdx
rename to web/docs/common/filters/_not.mdx
diff --git a/web/docs/common/filters/nxl.mdx b/web/docs/common/filters/_nxl.mdx
similarity index 100%
rename from web/docs/common/filters/nxl.mdx
rename to web/docs/common/filters/_nxl.mdx
diff --git a/web/docs/common/filters/nxr.mdx b/web/docs/common/filters/_nxr.mdx
similarity index 100%
rename from web/docs/common/filters/nxr.mdx
rename to web/docs/common/filters/_nxr.mdx
diff --git a/web/docs/common/filters/or.mdx b/web/docs/common/filters/_or.mdx
similarity index 100%
rename from web/docs/common/filters/or.mdx
rename to web/docs/common/filters/_or.mdx
diff --git a/web/docs/common/filters/ova.mdx b/web/docs/common/filters/_ova.mdx
similarity index 100%
rename from web/docs/common/filters/ova.mdx
rename to web/docs/common/filters/_ova.mdx
diff --git a/web/docs/common/filters/ovr.mdx b/web/docs/common/filters/_ovr.mdx
similarity index 100%
rename from web/docs/common/filters/ovr.mdx
rename to web/docs/common/filters/_ovr.mdx
diff --git a/web/docs/common/filters/sl.mdx b/web/docs/common/filters/_sl.mdx
similarity index 100%
rename from web/docs/common/filters/sl.mdx
rename to web/docs/common/filters/_sl.mdx
diff --git a/web/docs/common/filters/sr.mdx b/web/docs/common/filters/_sr.mdx
similarity index 100%
rename from web/docs/common/filters/sr.mdx
rename to web/docs/common/filters/_sr.mdx
diff --git a/web/support/blogBasicSlackClone.js b/web/support/blogBasicSlackClone.js
deleted file mode 100644
index feabcadb291..00000000000
--- a/web/support/blogBasicSlackClone.js
+++ /dev/null
@@ -1,183 +0,0 @@
-export const nextJsConfig1 = `
-const withSass = require('@zeit/next-sass')
-module.exports = withSass({
- env: {
- SUPABASE_URL: 'http://localhost:8000',
- SUPABASE_KEY: 'examplekey',
- },
-})
-`
-
-export const store1 = `
-import { useState, useEffect } from 'react'
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_KEY)
-
-export const useStore = ({ channelId }) => {
- const [channels, setChannels] = useState([])
- const [messages, setMessages] = useState([])
-
- // Fetches messages for the channel and starts the channel listeners
- const reloadStore = () => {
- if (channelId) {
- fetchChannels(setChannels)
- fetchMessages(channelId, setMessages)
- }
- }
-
- // Update the store when the user changes the "channel"
- useEffect(reloadStore, [channelId])
-
- // Export properties to use in our app
- return { messages, channels, channelId }
-}
-
-// Get all the channels
-export const fetchChannels = async callback => {
- try {
- let { body } = await supabase.from('channels').select('*')
- if (callback) callback(body)
- return body
- } catch (error) {
- console.log('error', error)
- }
-}
-
-// Get all the messages and the authors in a single request
-export const fetchMessages = async (channelId, callback) => {
- try {
- let { body } = await supabase
- .from('messages')
- .eq('channel_id', channelId)
- .select(\`*, author:user_id(*)\`)
- .order('id', true)
- if (callback) callback(body)
- return body
- } catch (error) {
- console.log('error', error)
- }
-}
-
-`
-
-export const schema = `
--- USERS
-CREATE TABLE public.users (
- id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
- username text
-);
--- CHANNELS
-CREATE TABLE public.channels (
- id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
- slug text NOT NULL UNIQUE
-);
--- MESSAGES
-CREATE TABLE public.messages (
- id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
- message text,
- user_id bigint REFERENCES users NOT NULL,
- channel_id bigint REFERENCES channels NOT NULL
-);
--- Create the Replication publication for Supabase
-CREATE PUBLICATION supabase_realtime FOR ALL TABLES;
--- SOME DUMMY DATA
-INSERT INTO
- public.users (username)
-VALUES
- ('jarvis'),
- ('tonystark');
-INSERT INTO
- public.channels (slug)
-VALUES
- ('public'),
- ('random');
-INSERT INTO
- public.messages (message, channel_id, user_id)
-VALUES
- ('Hello World 👋', 1, 1),
- ('Goodbye cruel world.', 2, 1);
-`
-
-export const dockerfile = `
-version: '3'
-
-services:
- supabase:
- image: supabase/supabase-dev:latest
- ports:
- - "8000:8000"
- environment:
- DB_HOST: db
- DB_NAME: postgres
- DB_USER: postgres
- DB_PASSWORD: postgres
- DB_PORT: 5432
- DB_SCHEMA: public
- depends_on:
- - db
- db:
- image: postgres:12
- ports:
- - "5432:5432"
- volumes:
- - ./db:/docker-entrypoint-initdb.d/
- command:
- - "postgres"
- - "-c"
- - "wal_level=logical"
- environment:
- POSTGRES_DB: postgres
- POSTGRES_USER: postgres
- POSTGRES_PASSWORD: postgres
- POSTGRES_PORT: 5432
-`
-
-export const channelPage1 = `
-import Link from 'next/link'
-import { useRouter } from 'next/router'
-import { useStore } from '../lib/Store'
-
-const ChannelsPage = props => {
- const router = useRouter()
- const { channelId } = router.query
- const { messages, channels } = useStore({ channelId })
-
- return (
- <div>
- <nav>
- <div>
- <button>New Channel</button>
- </div>
- <div>
- <h3>Channels</h3>
- </div>
- <ul>
- {channels.map(channel => (
- <li>
- <Link href="/[channelId]" as={\`/\${channel.id}\`}>
- <a>{channel.slug}</a>
- </Link>
- </li>
- ))}
- </ul>
- </nav>
- <main>
- <div>
- <h3>Messages</h3>
- </div>
- {messages.map(message => (
- <div>
- <p>
- <strong>{message.author.username}</strong>
- </p>
- <p>{message.message}</p>
- </div>
- ))}
- </main>
- </div>
- )
-}
-
-export default ChannelsPage
-`
\ No newline at end of file