Working with Bolt.new and Supabase AI, read only?
Hello,
Im new trying to use supabase with Bolt.new and Im struggling. It seems the changes Im making in bolt are not pushed into my table. So I tried to edit my table with the AI and its read only? I understand nothing about the policies and what not.
Any help is appreciated.
85 Replies
Even using the SQL editor it doesnt seem to work.
I dont understand, BOLT correctly create the table with the rows and what not, but it fails at adding content. Only way I found so far is to ask it to make a .CSV and upload that.
You haven't shown anything that you have tried so not much we can help you with here. Telling and not showing isn't very helpful. You mentioned the SQL editor not working but what does that mean? what did you actually try to do there? what error did you get?
Valid points, the thing is, there is not much to show because as stated, BOLT is failing to change the table.
When I use the SQL editor. I often get the message "Success. No rows returned" but the rows are not added. I do a search and they are not there.
I asked the supabase AI to do the change itself, and I get that message "ERROR: cannot execute ALTER TABLE in a read-only transaction".
So I asked the Supabase AI to edit the policies to allow both itself and bolt.new to make alteration to the table, and I get a similar message.
So in short my question is, how do I setup the policies or anything else so the AI can change the tables?
INSERT INTO translations (key, value, lang, namespace) VALUES
('dashboard.title', 'Tableau de bord', 'fr', 'translation'),

ok it seems search using the browser doesnt work.
so I guess the SQL function work.

I could share my screen, whenever you are available if you want and its permitted.
return (
<PageLayout
title={t('translation:dashboard.title')}
subtitle={t('translation:dashboard.subtitle')}


Policies doesn't stop you from making changes and wouldn't trigger a cannot execute error message. This is more likely a grant issue. How was the
translations
table created? are you getting the error when trying to alter the translations table?it was created by BOLT, but the table itself was empty, I had to use a SQL to fill it, or I used .CSV in another instance.
Row level security (RLS) is already enabled on this table, so even if the ALTER was successful it wouldn't be doing anything to the table.
Your table doesn't seem to be read only as you've inserted data via the SQL editor and I'm sure you can probably insert data via the Table editor too.
yes it works that way
so there is a policy that says its read only, but its not really read only because I can edit it?
I thought that was only for any modification coming from outsite the supabase interface
There is no policy that says it's read only.
Oh wait, yes the policy you created is for SELECT (read) only, so you would need to add an
INSERT
policy if you want to write to that table.yeah I was confused...

You can edit from the Supabase Dashbard because the Dashboard uses an elevated user that bypasses RLS.
yeah that makes sense, so the policies have no impact when using the supabase UI.
Ok so I need a write policies for Bolt.new to be able to make changes?
No not in it's default state. You can however test the policies by changing the role of the user inside of the Supabase Dashboard
I don't know how Bolt.new works so cannot advice you on that.
Yeah well It seems they are integrated into each other. Im sure others are using Supabase effectively using Bolt.New so Im wondering if Im doing something wrong in Supabase.

Probably better to ask in the supabase channel in the Bolt discord.
I will check there... so what you are saying is that everything seems fine on the SupaBase side and Bolt should be able to write into it. So, if it doesnt, its a bold problem?
if there is no write policies on that table, how can bolt write into it if its read only?
Can you help me test that? Because right now Im failing to make a policie.

Yet again I don't know how bolt works, I don't know what role bolt AI uses. You are best asking on their discord.
I understand, all I am asking is help to open all the doors so I can eliminate that as a possible blocade.
There is no 1 size fits all policy. Row level security policies are based on your project requirements. You should read up on them and understand how they work before continuing any further.
I don't understand what you are asking here? are you asking how to disable RLS so you can test to see if its the cause of Bolt not being able to write to the table?
Ya
In this screenshot there is a Disable RLS button, just click on it and it should be disabled.
k Im gonna try that.
is there an effective way to filter to find a key or a value with a part of the key value and not EXACTLY what it is since the search fonction of the browser doesnt work with the supabase table?
There is a filter option in the Table editor.
yeah the Bolt.new AI is confused not its not attempting to update the database probably because of my previous queries, it game me a SQL that correctly updated the database but its not finding the result.


yeah but it seems it only works with the EXACT query, not just "Test" for instance
See :

You should read up on how SQL filters work, it will give you a better understanding of how to use the UI. The UI uses SQL filters.
why make things simple, right?
XD
ok it seems to me that im at a dead end here... if I show you my fetch code, can you help with that or its beyond your scope?
You can share the code here
k thanks, 2sec.
It's literally as simple as it can be. The issue here is you are fully relying on AI but you need to have some understanding of the underlying technologies you are relying on it to help you with. Otherwise everything is going to seem difficult.
well if a simple filter require me to into SQL instead of typing "test" and it gives me the rows with the word "test" in them, it sound overly complicated.
It's a database, that's how databases work.
The filter is part of the database? All Im saying is it should have a "contain", not just equal, greater than... etc.
Terminologies are database terminologies, it uses
like
instead of contain
, contain
doesn't exist in most relational database systems. This is why I said relying on AI without understanding the underlying technologies won't take you far.


seems to me like is not working, or Im dumb.
omg my "i18n.ts" is .ts, this is incorrect, right?
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import HttpBackend from 'i18next-http-backend';
import { createClient } from '@supabase/supabase-js';
// Initialize Supabase client
const supabaseUrl = import.meta.env.VITE_SUPABASE_URL;
const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY;
if (!supabaseUrl || !supabaseAnonKey) {
console.error('❌ Variables d'environnement Supabase manquantes');
throw new Error('VITE_SUPABASE_URL et VITE_SUPABASE_ANON_KEY sont requis');
}
const supabase = createClient(supabaseUrl, supabaseAnonKey);
I changed the file to txt so I could add it here.
This is why I said having some knowledge of how the underlying technologies work will help.
Yeah we all start somewhere, Im starting.
ok so I need to add "%" for some reason... sounds to me this could easily be simplified with a dumb proof UI.
Which part of this file do you want me to take a look at?
Supposebly, this is all the code that fetch the "dashboard.title" from the database but it doesnt work.
The UI is exactly what a database UI should be like. Changing this behaviour would be breaking it for anyone who understands how databases should work.
Eventually, everything will be simplified, and thats why people are switching to AI... so they dont have to type "%" when they want to find a row with a word part of an entry.
Are you getting to any of the
console.log's
inside of the i18n file?yes got it here, 2sec
Clé manquante: dashboard.subtitle (translation:fr)
missingKeyHandler @ i18n.ts:95
send @ i18next.js?v=c48ac005:644
translate @ i18next.js?v=c48ac005:662
t @ i18next.js?v=c48ac005:2226
fixedT @ i18next.js?v=c48ac005:2214
Dashboard @ Dashboard.tsx?t=1755191086740:31
renderWithHooks @ chunk-WRD5HZVH.js?v=d58279d8:11548
updateFunctionComponent @ chunk-WRD5HZVH.js?v=d58279d8:14582
beginWork @ chunk-WRD5HZVH.js?v=d58279d8:15924
beginWork$1 @ chunk-WRD5HZVH.js?v=d58279d8:19753
performUnitOfWork @ chunk-WRD5HZVH.js?v=d58279d8:19198
workLoopSync @ chunk-WRD5HZVH.js?v=d58279d8:19137
renderRootSync @ chunk-WRD5HZVH.js?v=d58279d8:19116
performSyncWorkOnRoot @ chunk-WRD5HZVH.js?v=d58279d8:18874
flushSyncCallbacks @ chunk-WRD5HZVH.js?v=d58279d8:9119
flushSync @ chunk-WRD5HZVH.js?v=d58279d8:18959
scheduleRefresh @ chunk-WRD5HZVH.js?v=d58279d8:20004
(anonymous) @ @react-refresh:188
performReactRefresh @ @react-refresh:180
(anonymous) @ @react-refresh:474
setTimeout
(anonymous) @ @react-refresh:465
validateRefreshBoundaryAndEnqueueUpdate @ @react-refresh:512
(anonymous) @ Dashboard.tsx:104
(anonymous) @ client:34
(anonymous) @ client:218
(anonymous) @ client:193
queueUpdate @ client:193
await in queueUpdate
(anonymous) @ client:638
handleMessage @ client:636
(anonymous) @ client:546
dispatchEvent @ .webcontainer@runtime.96435430.js:26
_handleMessage @ .webcontainer@runtime.96435430.js:26
_0x4a5968.<computed> @ .webcontainer@runtime.96435430.js:26Understand this warning
i18next::translator: missingKey fr translation test.verification test.verification
it says missing key
And therein lies the problem, everyone thinks AI is a solution to every problem whilst AI hallucinates more than anything else. Good luck with this pipe dream.
I understand your point, but Im pretty sure we are heading that way, obviously Im not a programmer. Yet I made a complete fonctional game using AI.
I can't see that message anywhere in the file you shared. Is any of the console.logs getting printed to your terminal. This will be the easiest way to find where the issue starts at.
Its from the console in the browser, you are asking about the line doing that check?
The console.log's I'm referring to is in the code you shared, if you look you will see a bunch of
console.log
written in it with some messages, if we can figure out which was the last one that got called then we can zone in on where the issue might be.The last console log is "Clé manquante: dashboard.underConstruction.comingSoon (translation:fr)
missingKeyHandler @ i18n.ts:129..."
Maybe we could do a share screen it you could guide me to exactly what you need.
There are MANY missing keys
supposedly, despite some of them definitely existing in the database, especially the main example being "dashboard.title"
Is this being printed in your console? console.log(
✅ ${data.length} traductions chargées pour ${namespace}
);Chargement des traductions: fr/translation
i18n.ts:27 🔄 Chargement des traductions: fr/common
i18n.ts:27 🔄 Chargement des traductions: fr/navigation
i18n.ts:27 🔄 Chargement des traductions: fr/fileUpload
i18n.ts:27 🔄 Chargement des traductions: fr/forms
i18n.ts:27 🔄 Chargement des traductions: fr/tables
i18n.ts:27 🔄 Chargement des traductions: fr/article
i18n.ts:27 🔄 Chargement des traductions: fr/client
i18n.ts:27 🔄 Chargement des traductions: fr/company
i18n.ts:27 🔄 Chargement des traductions: fr/employee
✅ 44 traductions chargées pour translation
18next::backendConnector: loading namespace navigation for language fr failed failed loading /locales/fr/navigation.json; status code: undefined
So it's saying there are some keys missing, are those keys in your database?
see the reply from " — 13:20" for the supabase screenshot showing the entry and this screenshot for the result :

This doesn't have anything to do with the key being there or not as the i18n plugin is what handles these.
Are there more than 1000 entries in the
translations
table?723 records
it needs to be optimised, many duplicated values
so what you are saying is that its incorrectly handling the test?
After this bit of code
write a
and see what the length number is.
If this length doesn't show 723, then it's not getting every record in your database. If it does then the issue is elsewhere in your code.
understood, on it.
Actually wait what I said is incorrect as it has a
.eq
filter on itthat debug log is framented into 91 logs. I dont get the total.
Let me fix it, unless you can write it quickly.
Yeah that was incorrect, Let me provide a more updated code to the effect of what I'm trying to do.
Add this right after the
try {
in your code on the next line
Here is a screenshot incase it's not clear where to put it from my above message

723
723 records
so they are all charged
Ok so the query is getting all the data from your database
The issue is elsewhere in your code
You can remove that bit of code I asked you to add now
You should tell AI that the i18n isn't picking up some keys and ask it to fix the issue.
yeah indeed... its a mess, maybe I should remove all the .json bits and fallback.
Thank you for trying to help.
No problem. I hope you get it resolved soon.
Pass my feedback about that filter to the devs. 😉
Also remember to re-enable RLS on your table, you don't want to leave that disabled as someone can delete all records from that table.
done !
I'm not a Supabase staff and I like the filter the way it is 😁
I have no doubt about that ! 😆
You are now my vibe coder friend for life 😁
Ahaha nice ! 🏆