Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blazor WebAsembly Access Database

Tags:

c#

blazor

I am just thinking that, Since Blazor Webassembly can running in browser independently(off-line), how can it access database without a WebAPI?

Can Blazor Webassembly use sqlite in browser directly?

like image 981
YuZhao Avatar asked Mar 04 '23 01:03

YuZhao


2 Answers

You can use in browser DBs IndexedDB, Web SQL or local storage throught JSInteropt

like image 64
agua from mars Avatar answered Mar 06 '23 20:03

agua from mars


How can it access database without a WebAPI?

It can't access any database without a Web Api. You can only access the JavaScript localStorage and sessionStorage Apis, using JSInterop. Right now Blazor does not support such adventures, but I'm not much acquainted with products created by third parties and the community... perhaps they've created something that can be useful for you.

like image 42
enet Avatar answered Mar 06 '23 21:03

enet