课程: Supabase Essential Training

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Querying with the JavaScript client

Querying with the JavaScript client

- [Instructor] As tables and views are added in Supabase, an API is being generated for access. Let's have a look at how this API can be accessed and used in an application. Here in the documentation section of the Supabase dashboard, we're looking at the items table. Notice here under JavaScript, we have several things that look sort of like SQL, but they're not exactly. For instance, if we want to insert rows into the items table, we can use the from function here to do that. Underneath it is a rest endpoint. Notice that there is no SQL happening here at all. The JavaScript client makes it feel like SQL, but it's actually a little different. Now let's open up our text editor, so we can write some code that uses this JavaScript. We are using this line to load the Supabase JavaScript client from a CDN. This way we don't have to download it, and we don't have to manage the version. On this second line, we are initializing that Supabase client. Let's open up client.js now. You'll notice…

内容