The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Hides common filters using new underscore method
Paul Copplestone44bda5a9b247
diff --git a/web/docs/common/CommonFilters.js b/web/docs/common/CommonFilters.jsindex 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.mdxsimilarity index 100%rename from web/docs/common/filters/adj.mdxrename to web/docs/common/filters/_adj.mdxdiff --git a/web/docs/common/filters/cd.mdx b/web/docs/common/filters/_cd.mdxsimilarity index 100%rename from web/docs/common/filters/cd.mdxrename to web/docs/common/filters/_cd.mdxdiff --git a/web/docs/common/filters/cs.mdx b/web/docs/common/filters/_cs.mdxsimilarity index 100%rename from web/docs/common/filters/cs.mdxrename to web/docs/common/filters/_cs.mdxdiff --git a/web/docs/common/filters/eq.mdx b/web/docs/common/filters/_eq.mdxsimilarity index 100%rename from web/docs/common/filters/eq.mdxrename to web/docs/common/filters/_eq.mdxdiff --git a/web/docs/common/filters/filter.mdx b/web/docs/common/filters/_filter.mdxsimilarity index 100%rename from web/docs/common/filters/filter.mdxrename to web/docs/common/filters/_filter.mdxdiff --git a/web/docs/common/filters/gt.mdx b/web/docs/common/filters/_gt.mdxsimilarity index 100%rename from web/docs/common/filters/gt.mdxrename to web/docs/common/filters/_gt.mdxdiff --git a/web/docs/common/filters/gte.mdx b/web/docs/common/filters/_gte.mdxsimilarity index 100%rename from web/docs/common/filters/gte.mdxrename to web/docs/common/filters/_gte.mdxdiff --git a/web/docs/common/filters/ilike.mdx b/web/docs/common/filters/_ilike.mdxsimilarity index 100%rename from web/docs/common/filters/ilike.mdxrename to web/docs/common/filters/_ilike.mdxdiff --git a/web/docs/common/filters/in.mdx b/web/docs/common/filters/_in.mdxsimilarity index 100%rename from web/docs/common/filters/in.mdxrename to web/docs/common/filters/_in.mdxdiff --git a/web/docs/common/filters/is.mdx b/web/docs/common/filters/_is.mdxsimilarity index 100%rename from web/docs/common/filters/is.mdxrename to web/docs/common/filters/_is.mdxdiff --git a/web/docs/common/filters/like.mdx b/web/docs/common/filters/_like.mdxsimilarity index 100%rename from web/docs/common/filters/like.mdxrename to web/docs/common/filters/_like.mdxdiff --git a/web/docs/common/filters/lt.mdx b/web/docs/common/filters/_lt.mdxsimilarity index 100%rename from web/docs/common/filters/lt.mdxrename to web/docs/common/filters/_lt.mdxdiff --git a/web/docs/common/filters/lte.mdx b/web/docs/common/filters/_lte.mdxsimilarity index 100%rename from web/docs/common/filters/lte.mdxrename to web/docs/common/filters/_lte.mdxdiff --git a/web/docs/common/filters/match.mdx b/web/docs/common/filters/_match.mdxsimilarity index 100%rename from web/docs/common/filters/match.mdxrename to web/docs/common/filters/_match.mdxdiff --git a/web/docs/common/filters/neq.mdx b/web/docs/common/filters/_neq.mdxsimilarity index 100%rename from web/docs/common/filters/neq.mdxrename to web/docs/common/filters/_neq.mdxdiff --git a/web/docs/common/filters/not.mdx b/web/docs/common/filters/_not.mdxsimilarity index 100%rename from web/docs/common/filters/not.mdxrename to web/docs/common/filters/_not.mdxdiff --git a/web/docs/common/filters/nxl.mdx b/web/docs/common/filters/_nxl.mdxsimilarity index 100%rename from web/docs/common/filters/nxl.mdxrename to web/docs/common/filters/_nxl.mdxdiff --git a/web/docs/common/filters/nxr.mdx b/web/docs/common/filters/_nxr.mdxsimilarity index 100%rename from web/docs/common/filters/nxr.mdxrename to web/docs/common/filters/_nxr.mdxdiff --git a/web/docs/common/filters/or.mdx b/web/docs/common/filters/_or.mdxsimilarity index 100%rename from web/docs/common/filters/or.mdxrename to web/docs/common/filters/_or.mdxdiff --git a/web/docs/common/filters/ova.mdx b/web/docs/common/filters/_ova.mdxsimilarity index 100%rename from web/docs/common/filters/ova.mdxrename to web/docs/common/filters/_ova.mdxdiff --git a/web/docs/common/filters/ovr.mdx b/web/docs/common/filters/_ovr.mdxsimilarity index 100%rename from web/docs/common/filters/ovr.mdxrename to web/docs/common/filters/_ovr.mdxdiff --git a/web/docs/common/filters/sl.mdx b/web/docs/common/filters/_sl.mdxsimilarity index 100%rename from web/docs/common/filters/sl.mdxrename to web/docs/common/filters/_sl.mdxdiff --git a/web/docs/common/filters/sr.mdx b/web/docs/common/filters/_sr.mdxsimilarity index 100%rename from web/docs/common/filters/sr.mdxrename to web/docs/common/filters/_sr.mdxdiff --git a/web/support/blogBasicSlackClone.js b/web/support/blogBasicSlackClone.jsdeleted file mode 100644index 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