Code Monkey home page Code Monkey logo

supabase's People

Contributors

alaister avatar awalias avatar charislam avatar dependabot[bot] avatar dragarcia avatar dshukertjr avatar fsansalvadore avatar gregnr avatar hallidayo avatar hf avatar inian avatar isaiah-hamilton avatar ivasilov avatar j0 avatar joshenlim avatar kangmingtay avatar kevcodez avatar kiwicopple avatar mansueli avatar mildtomato avatar olirice avatar phamhieu avatar ramirond avatar saltcod avatar silentworks avatar soedirgo avatar sweatybridge avatar thorwebdev avatar w3b6x9 avatar ziinc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

supabase's Issues

Docs: snippets/examples don't return values (single, order etc.)

  • I'm submitting a ...
    [ *] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    examples in docs need updating to snippets that will actually return something
    https://supabase.io/docs/library/get#order
    the snippets and examples for
    order, single, filter, etc. won't return anything as they are, we should include a .select(*) in the example so that the snippet can be copy/pasted as a working example, and users can understand the context, i.e. how they should be combined with a select()

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

Manifest for docker not found

  • I'm submitting a ...
    [x ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary

Hi there, just tried installing via docker with the following docker-compose file

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"
command:
- "postgres"
- "-c"
- "wal_level=logical"

when running docker-compose up -d I get error ERROR: manifest for supabase/supabase-dev:latest not found: manifest unknown: manifest unknown I can't seem to find a repository more related to docker image.

All the best

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

Search results showing sub-pages

  • I'm submitting a ...
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary

The search box is showing results from our "includes". Here you can see "eq" and "CommonFilters":

image

But these are just sections which are supposed to be "included" into other pages

image

The solution is probably just moving these common "includes" out of the "docs" folder.

Caused by #28

Change Mapper does not account for pgsql array data types

  • I'm submitting a ...
  • bug report
  • feature request
  • question about the decisions made in the repository
  • question about how to use this project
  • Summary
    Arrays are currently being returned as strings, leaving it to the user to convert it themselves.

Postgres connection url to connect with BI tools

  • I'm submitting a ...
    [ ] question about how to use this project

  • Summary
    Where can I access the Postgres connection URL to connect the Db with Metabase or PowerBI in order to analyze the data easily?

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

Prepared Parameters

  • I'm submitting a ...
    [ ] bug report
    [ ] feature request
    [x] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    Hey guys
    Just a question if the insert functionality is using prepared statements?

Confirm Netlify builds are working correctly

This issue is to track if the Netlify build cron job is working correctly, especially for the traction chart. It's scheduled daily at 0200 SGT, will close if the chart gets updated.

Dependabot couldn't find a package.json for this project

Dependabot couldn't find a package.json for this project.

Dependabot requires a package.json to evaluate your project's current JavaScript dependencies. It had expected to find one at the path: /libraries/supabase-js/package.json.

If this isn't a JavaScript project, or if it is a library, you may wish to disable updates for it from within Dependabot.

View the update logs.

Give warning if someone uses `https` on localhost dev

I encountered a HTTP 521 error when trying to use a https://... url in createClient when developing on localhost, perhaps supabase-js could print a warning message to console if it notices that the source is 127.0.0.1 and suggest downgrading the url to http:// in this environment

Ability to save queries/snippets on the SQL page

Requested by @sieglerz

At the moment the queries/history are lost when a user navigates away from the page. We should allow them to save/store/persist the snippets.

BTW sieglerz, this is definitely in the pipeline, but a bit lower on the priorites. Long-term we will offer custom-built dashboards, made of queries/graphs etc

.like() & .ilike() does not work with '%'

  • I'm submitting a ...
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    When passing a string pattern with the percentage sign (%) to the function .like() or .ilike(), the expected output is not attained.

  • Other information
    According to the PostgREST documentation, the percentage sign (%) should be replaced with an asterisk (*) instead.

Update homepage example

image

Our "Update multiple rows" example is a bit confusing, since the filter criteria will probably only update one row

rpc() is not implemented

  • I'm submitting a ...
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

@dragarcia I just want to check if you implemented the rpc function in supabase-js? I can't find it in any of the branches?

Can't use supabase with Svelte rollup

  • I'm submitting a ...
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    supabase will not compile with Svelte.

I run:

npx degit sveltejs/template test1
npm install
npm install --save @supabase/supabase-js
npm run dev

Finally, in my App.svelte file I put:

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

// Create a single supabase client for interacting with your database
const supabase = createClient("https://xyzcompany.supabase.co", "1a2b-3c4d-5e6f-7g8h");

And I get the following error message:

> [email protected] dev C:\PycharmProjects\test1
> rollup -c -w

rollup v2.11.2
bundles src/main.js โ†’ public\build\bundle.js...
[!] Error: Unexpected token (Note that you need @rollup/plugin-json to import JSON
files)
node_modules\websocket\package.json (2:9)
1: {
2:   "_from": "websocket@^1.0.31",
            ^
3:   "_id": "[email protected]",
4:   "_inBundle": false,
Error: Unexpected token (Note that you need @rollup/plugin-json to import JSON file
s)
    at error (C:\PycharmProjects\test1\node_modules\rollup\dist\shared\rollup.js:217:30)
    at Module.error (C:\PycharmProjects\test1\node_modules\rollup\dist\shared\rollup.js:15145:16)
    at tryParse (C:\PycharmProjects\test1\node_modules\rollup\dist\shared\rollup.js:15034:23)
    at Module.setSource (C:\PycharmProjects\test1\node_modules\rollup\dist\shared\rollup.js:15436:30)
    at ModuleLoader.addModuleSource (C:\PycharmProjects\test1\node_modules\rollup\dist\shared\rollup.js:17430:20)

If I remove the lines from my App.svelte file, npm run dev works fine.

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
    The error message suggests the problem is a lack of "@rollup/plugin-json", so I ran the following:
    npm install @rollup/plugin-json --save-dev
    ...but it didn't help. Same exact error.
    I'm not a Javascript genius, so I may be doing something wrong, but I'm open to suggestions.

Nav bar links are opening in a new tab

image

These links should be recognised as internal links an open in the same tab. At the moment they are all opening a new tab.

Possible cause: we are overriding the default theme in ./web/src/theme/DocSidebar

Implement `eq` filter on the realtime subscriptions

  • I'm submitting a ...
    [ ] bug report
    [x] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

Now that we have column level filtering in Realtime (here: supabase/realtime#15) we should be able to implement this into supabase-js with the following syntax

supabase
    .from('users')
    .eq('id', 2)
    .subscribe()

which would filter to only receive changes from user ID 2.

To do this, the "room name" should be the same format as PostgREST. i.e.:

realtime:public:users:id=eq.2

Vote for more plugins

This issue is for tracking requests/demand for more plugins/extensions. Give a thumbs up if you want an extension added.

Please refrain from adding comments unless you are adding an extension which isn't already listed.

Client side auth

Current state

At the moment we are providing key auth using an API key on each request. For the REST requests, this is passed as a header. For the sockets, this is necessarily passed as a URL parameter because most browsers strip the headers for Sockets.

This is not ideal. It is only considered safe on serverside where there is less chance of discovering the key.

Even if we allowed multiple keys, this doesn't solve authorization. Once a user is provided access, how do we ensure they aren't accessing other people's data? This is especially tricky for our realtime server, where we would need to run some logic for every change request to know if the change is relevant for each connected user.

Solution 0: Custom auth

This is a non-starter. We don't want to add our own auth system. We can integrate with others, but we don't want to force our opinionated systems on others. We should provide general solutions which work for everyone - even legacy systems.

Solution 1: RLS

We could leverage Postgres' Row level security, roles and users. This is very attractive since the level of security it provides is amazing. We would delegate much of this work to the tools which we use:

  • PostgREST Auth
  • Postgraphile Auth - we don't use this, but will probably offer GraphQL in the future so it makes sense to investigate their model. Also there is good feedback about their approach on HackerNews.

It would look something like this:

image

Pros

  • Definitely solves authentication
  • Extremely secure

Cons:

  • we rely on the customer to start modifying their schema. This is not ideal as the many people won't want to pollute their DB (I probably wouldn't).
  • authorization requests hammering the database. DDOS hell

Solution 2: Global API proxy

We can provide them with one API proxy per-project(database):

image

This proxy would need to run serverless functions so that the user can add their own logic. When we deploy a new server for them, we can add some basic rules (like we already have), and then it is up to them to add any advanced rules. We can offer plugins and templates to make this simple

Pros

  • Authorization at the edge. Keep the servers in a secure VPC
  • Very flexible. They create their own logic and can integrate with any service.
  • Adds a layer for "business logic": one of the complaints about PostgREST is that it's just CRUD, so you have to write business logic into the database (functions). This gives the user another place to deploy that logic (serverless functions).

Cons

  • Moves us away from a Postgres platform
  • A bit unclear if the system ties together... Do we have one Gateway per database? One per org? How does it look in the Dashboard? Might be very confusing to the customer.

Cannot use supabase on Expo project

  • I'm submitting a ...
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    Hi there, I tried to install and using supabase libary in my project. Unfortunately, I got an error

The package at "node_modules/@supabase/realtime-js/src/socket.js" attempted to import the Node standard library module "querystring". It failed because React Native does not include the Node standard library. Read more at https://docs.expo.io/versions/latest/introduction/faq/#can-i-use-nodejs-packages-with-expo
Failed building JavaScript bundle.
The package at "node_modules/@supabase/realtime-js/src/socket.js" attempted to import the Node standard library module "querystring". It failed because React Native does not include the Node standard library. Read more at https://docs.expo.io/versions/latest/introduction/faq/#can-i-use-nodejs-packages-with-expo

Screen Shot 2020-04-24 at 15 43 03

supabase-dev docker image doesn't work on Firefox

Testing:

  • Chrome: working
  • Safari: working
  • Firefox 72 - Not working
  • Firefox Dev - Not working
  • Firefox Alpha - Not working
  • Firefox 65 - Not working
  • Firefox 72: connecting to remote IP - Working
  • Firefox 72: connecting to local IP - not working
  • Firefox 72: connecting to local computer using named host - not working
  • Firefox - docker-compose - TBD

Missing License

  • I'm submitting a ...
    [ ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [x] question about how to use this project

  • Summary

I'm not sure what license this project is under, could you add it to the repo, please?
Looks really interesting though!

Realtime is not mapping empty arrays properly

  • I'm submitting a ...
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    When passing an empty array, realtime returns [NaN]

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
    In this scenario, days is an int array.

Sample Payload:
image

Sample Response:
image

Possible to self-host?

  • I'm submitting a ...
  • bug report
  • feature request
  • question about the decisions made in the repository
  • question about how to use this project
  • Summary

I maintain a Degoogle guide and Supabase is under consideration to be added as a Firebase alternative. Is it possible to self-host Supabase, or will it be possible in the future? If not, what country/ies are your hosting servers located in?

Thank you!

Second phantom subscription created on subscribe()

after running:

    const mySubscription = await supabase
      .from('messages')
      .on('*', callbackAction)
      .subscribe()

if I inspect supabase.subscriptions, I can see two subscriptions, the second of which is mostly empty:

Supabase {
  tableName: 'messages',
  restUrl: 'http://localhost:8000/rest/v1',
  realtimeUrl: 'ws://localhost:8000/realtime/v1',
  schema: 'public',
  uuid: '516eab5e-5f4b-3fb6-d049-8b7eeb02b03a',
  apikey: 'examplekey',
  socket: null,
  channel: null,
  listeners: {},
  queryFilters: []
}

the problem is if I pass it to supabase.removeSubscription it throws an exception:

     TypeError: Cannot read property 'disconnect' of null
      at Supabase.unsubscribe (src/Supabase.js:133:17)
      at SupabaseClient.removeSubscription (src/index.js:44:20)
      at Context.<anonymous> (test/integration/testRealtime.js:16:16)
      at processImmediate (internal/timers.js:439:21)

[realtime-js] Doctests are failing

There seem to be 2 problems, not with the tests themselves but rather with the doctest library:

  1. Not correctly validating
/**
 * Converts the value of an individual column
 * @param {String} columnName The column that you want to convert
 * @param {{name: String, type: String}[]} columns All of the columns
 * @param {Object} records The map of string values
 * @param {Array} skipTypes An array of types that should not be converted
 * @return {object} Useless information
 * 
 * @example
 * convertColumn('age', [{name: 'first_name', type: 'text'}, {name: 'age', type: 'int4'}], ['Paul', '33'], [])
 * //=>
 * 33
 * 
 * @example
 * convertColumn('age', [{name: 'first_name', type: 'text'}, {name: 'age', type: 'int4'}], ['Paul', '33'], ['int4'])
 * //=>
 * "33"
 */
export const convertColumn = (columnName, columns, records, skipTypes) => {
  let column = columns.find(x => x.name == columnName)
  if(skipTypes.includes(column.type)) return noop(records[columnName])
  else return convertCell(column.type, records[columnName])
}

Change the "33" to 33 and it will still return true.

  1. Unable to parse file
/**
 * Takes an array of columns and an object of string values then converts each string value
 * to its mapped type
 * @param {{name: String, type: String}[]} columns
 * @param {Object} records
 * @param {Object} options The map of various options that can be applied to the mapper
 * @param {Array} options.skipTypes The array of types that should not be converted
 * 
 * @example
 * convertChangeData([{name: 'first_name', type: 'text'}, {name: 'age', type: 'int4'}], {'Paul', '33'}, {})
 * //=>
 * { first_name: 'Paul', age: 33 }
 */
export const convertChangeData = (columns, records, options = {}) => {
  let result = {}
  let skipTypes = typeof options.skipTypes !== 'undefined' ? options.skipTypes : []
  Object.entries(records).map(([key, value]) => {
    result[key] = convertColumn(key, columns, records, skipTypes)
  })
  return result
}

This @example is causing the library to break.


The concept of the library is awesome, so I think we should pitch in to improve it. Other likely improvements:

We should be able to add descriptions to the examples (if it fits the JSdoc spec)

/**
 * @example Add an example description here
 * convertCell('bool', 'true')
 * //=>
 * true
 */

We should be able to add descriptions to the return values (if it fits the JSdoc spec)

/**
 * @example 
 * convertCell('bool', 'true')
 * //=> Add a return value description here
 * true
 */

Dart SDK

Congrats on the launch.๐Ÿš€

Wanted to ask about what's on the horizon for future SDK's, especially for Dart/Flutter who use native Kotlin/Java and Swift/Obj-C apis.

Reading data returns Promise instead of response

  • I'm submitting a ...
    [ x ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    When I read data from supabase, it returns a Promise instead of response array.

const getArtworks = async () => {
    try {
      let artworks = await supabase.from('artworks').select('*')
      return artworks
    } catch (error) {
      console.log('Error: ', error)
    }
  }

RFC: Licensing

@awalias I'm interested on your take on licensing.

There seem to be a wave of great opensource projects that have to switch to a more restrictive license, basically because their existence is threatened by the big cloud players. Here are some that I know of using Business Source.

I really like MIT / Apache2.0, but I have to sympathise with these companies. I think no matter what, we have to be on a fully permissive license (for everything?), but keen to hear your thoughts.

RFC: LiveQueries

No action required, I just want to kick off this discussion

At the moment we have implemented our realtime to listen to basic events:

supabase
  .from('users')
  .eq('id', 1)
  .subscribe()

But ideally we want to get to something like our select:

supabase
  .from('users')
  .eq('id', 1)
  .select(`
    id, 
    name,
    todos (id, description)
  `)

What would this look like? Ideally we could use the same select graph in our subscribe:

supabase
  .from('users')
  .eq('id', 1)
  .subscribe(`
    id, 
    name,
    todos (id, description)
  `)

Then we would get the updates for the users, but also any updates to their todos. This is incredibly challenging, because the middleware needs to receive all the change events then decide if event "fits" into a subscription. But the benefits are enormous.

For example, we are using MobX right now - imagine the mobx store was just one big subscription like above? You could even just write a React wrapper around your whole app - no store necessary.

It seems that that Postgraphile have worked out a lot of the complicated parts with LiveQueries.

They have a caveat on their docs that it's still unstable and should only be used for small graphs (understandable).

They also offer a plugin interface for the database listener: https://www.graphile.org/postgraphile/live-queries/#realtime-provider-plugins

This is where supabase/realtime could probably help. Their current plugin requires wal2json. They even call out that they need a separate server at scale. Also their implementation requires refetching the data:
https://www.graphile.org/postgraphile/live-queries/#performance

code scrolling broken on safari iOS

  • I'm submitting a ...
    [*] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    iphone 6s / ios 13.3 / safari

could not scroll horizontally on code samples on homepage

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

Incorrect Email for [email protected] - Alpha program message

  • I'm submitting a ...
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    Just a super small text change. The email address looks to be incorrect

Ref: https://app.supabase.io/account/me

image

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

supabase-js: match().update() not a valid combination

was expecting

      supabase
        .from('messages')
        .match({ id: 1 })
        .update({ message: 'updated message yo' })
        .then(console.log)
        .catch(console.error)

to update, but instead got:

{
  body: null,
  status: 400,
  statusCode: 400,
  statusText: '.update() cannot be invoked without any filters.'
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.