Introduction to accessing supabase with C#

Hi all, Intro question regarding C# and supabase. I’m totally new to web related programming with c#, but a web developer friend of mine pointed me towards supabase. (For context I am trying to use supabase to host a database with architectural floorplans that will interact with some custom 3D software and components I am building.)
I’m trying to follow the documentation on the c# components (and think) that I successfully connected to my database. However it is unclear to me how I can specify how to access a specific table / project from my API. Image 1 copying the code from the https://supabase.com/docs/reference/csharp/select help file Where is from <Movie> or <City> specified there in the examples? And what would I need to do? Image 2: My own database is a simple table with int, float and json entries.
So how could I for instance access all items in the Table 'gramercy' that have an area of 30 ? Thanks a lot for your help!
Ramon
No description
No description
No description
6 Replies
garyaustin
garyaustin3y ago
You have RLS off so should not need to log in a user or use the service_role. I don't know the C# syntax, but are you just asking how to filter or can you not get all the rows with no filter?
ramon
ramonOP3y ago
yes exactly! I don't understand how to get any rows. How do I select the table, (since the API key just connects to my supabase account, right? ). E.g. in the documentation, how do they go from initializing a new client to fetching data?
garyaustin
garyaustin3y ago
Once again, can't speak to the C# client, but normally with the clients you do supabase = createClient with your url and anon key. Then if you have RLS off you can immediately read the database using result = supabase.from('table').select() (js client). There are no steps needed in between if you are not signing in a user. The C# docs you show seem to say the same for that client. This has more docs on C#, not sure they will help. I'm not sure how the Models part comes into play as I don't use C#. https://github.com/supabase-community/supabase-csharp
GitHub
GitHub - supabase-community/supabase-csharp: A C# Client library fo...
A C# Client library for Supabase. Contribute to supabase-community/supabase-csharp development by creating an account on GitHub.
ramon
ramonOP3y ago
I see! ok, I think I figured it out. I have to add a class that "mirrors" my online database, and reference it from there. and then its similar to the js workflows, fetching data... Thanks for your help @garyaustin !
No description
Rozko
Rozko3y ago
Hey @ramon are you integrating supabase in plain c# console project? I've never seen any examples of using supabase as a DI in .net.
Patra0o
Patra0o2y ago
Hi @ramon , how'd you setup auth?

Did you find this page helpful?