https://supabase.com/ logo
Join Discord
Powered by
# help
  • j

    Jaeden

    10/08/2021, 9:17 PM
    Yeah this is def really frustrating. Now you have to essentially deploy to production to be able to test things :/ :/ big no no
  • j

    Julián

    10/09/2021, 1:57 AM
    Hi folks, how are you handling state in React Native apps, what tools, tips, tricks ?
  • b

    Barba

    10/09/2021, 8:56 AM
    here is the code im using to grab the club and all the club_pages rows
    • 1
    • 5
  • y

    YelloJello

    10/09/2021, 9:09 AM
    MobX ftw, you can get very far with just context and hooks too though, throw in a data-fetching lib like React Query or useSWR and you've got all bases covered. I default to the latter nowadays
  • j

    Julián

    10/09/2021, 12:35 PM
    Thanks man
  • n

    Nine

    10/09/2021, 12:58 PM
    One question to the @User , when saving for example an index.html file in the bucket is there some option which when we take the link gives us the exact html instead of it being inside of the tag and another html ?
  • d

    darora

    10/09/2021, 1:16 PM
    @User The Storage service does not modify the contents of the files you store. Any html mangling is an artifact of how browsers render the contents. e.g.
    Copy code
    $ curl -o - https://_______.supabase.in/storage/v1/object/_/_/index.html
    <html>foo</html>
    Note that we don't support serving HTML directly off the storage buckets, so a browser won't be able to render the HTML file you're uploading.
  • t

    Twelve

    10/09/2021, 2:10 PM
    Hi there @User, Is there a way to download folder files from storage as in I have a folder filled with images/txt files and I want to download all of them at once?
  • h

    HarryET

    10/09/2021, 2:55 PM
    Hey! Is there a way to do a query on an array e.g. I have a table with an array of ids and i'd like to select all where the array includes X is there a way todo that?
  • b

    Bryan K.

    10/09/2021, 5:36 PM
    Search in PostgreSQL Array
    Copy code
    SELECT
        name,
        phones
    FROM
        contacts
    WHERE
        '(408)-589-5555' = ANY (phones);
    from https://www.postgresqltutorial.com/postgresql-array/
  • z

    zeeshanok

    10/09/2021, 5:38 PM
    is there a way to execute raw sql in the supabase dart library?
  • z

    zeeshanok

    10/09/2021, 5:39 PM
    as in, directly run
    select column from table
    without any of the extra functions
  • h

    HarryET

    10/09/2021, 5:40 PM
    how would you do it with the SDK?
  • n

    Nine

    10/09/2021, 5:43 PM
    can you download more files at the same time from the buckets? As in if we have a subfolder with 2-3 files, something like:
    Copy code
    js
    const { data, error } = await supabase
      .storage
      .from('storage')
      .download(['test/item1', 'test/item2', 'test/item3'])
    Or:
    Copy code
    js
    const { data, error } = await supabase
      .storage
      .from('storage')
      .download('test/item1')
      .download('test/item2')
      .download('test/item3')
    Hope I kinda got the point across 🙂
  • b

    Bryan K.

    10/09/2021, 5:53 PM
    I think you would add the
    .cs('array_column', ['array', 'contains'])
    filter to the function.
  • h

    HarryET

    10/09/2021, 5:54 PM
    Where do you put the value?
  • h

    HarryET

    10/09/2021, 5:55 PM
    Also it dosen't seam to work on this query:
    Copy code
    ts
    const { data, error } = await supabase
            .from<MentionedMessageType>("messages")
            .select(messageQuery);
  • b

    Bryan K.

    10/09/2021, 5:57 PM
    Copy code
    const { data, error } = await supabase
      .from('table_name')
      .select(*)
      .cs('ids_array_column', ['X'])
  • h

    HarryET

    10/09/2021, 5:58 PM
    X being the value?
  • b

    Bryan K.

    10/09/2021, 5:59 PM
    yes, and I think that if it is numeric data in the array column and not strings, you can omit the single quotes around it and you might even be able to drop the square brackets if you are searching for a single value. more like
    .cs('ids_array_column', X)
  • b

    Bryan K.

    10/09/2021, 6:00 PM
    I don't have anything handy to test this with, so I am just chucking my best guess up here.
  • h

    HarryET

    10/09/2021, 6:00 PM
    Yup it works
  • h

    HarryET

    10/09/2021, 6:00 PM
    Thanks ❤️
  • b

    Bryan K.

    10/09/2021, 6:01 PM
    Glad to help, and now I know a bit more too, thanks for asking.
  • h

    HarryET

    10/09/2021, 6:01 PM
    Np, hopefully this helps more people in the future
  • n

    Nine

    10/09/2021, 6:34 PM
    @User would you know how to retrieve multiple files from a specific bucket?
  • n

    Nine

    10/09/2021, 6:34 PM
    if we have a folder and want 2-3 files out of it
  • b

    Bryan K.

    10/09/2021, 6:51 PM
    I don't, but it looks like you would probably need to fetch a list of files first, then download each one that matches your criteria. https://supabase.io/docs/reference/javascript/storage-from-list then https://supabase.io/docs/reference/javascript/storage-from-download I am not sure if you can add a filter function to the
    from.list()
    function. If you could, that would be awesome! Something like...
    Copy code
    const { data, error } = await supabase
      .storage
      .from('avatars')
      .list('folder', {
        limit: 100,
        offset: 0,
        sortBy: { column: 'name', order: 'asc' },
      })
      .filter('name', 'contains', 'filename')
    If there isn't a way to filter in the
    .storage
    call, then I would probably get the list of files in the
    data
    variable and use JS code to reduce that down to what I want from it and then run the
    .from.download()
    function to download the files or the
    from.createSignedUrl()
    function to get a set of URLs to provide to someone to download those files to their local device.
  • n

    Nine

    10/09/2021, 6:54 PM
    What I need essentially is the values of the files and download is just for me to retrieve the values and I thought maybe there is a json response with all the files (3) and for each file I can get the text() easily and display it then
  • n

    Nine

    10/09/2021, 6:56 PM
    I kinda cannot call download directly after the list
1...104105106...316Latest