# How to use WebSql with ionic?

**URL:** <https://forum.ionicframework.com/t/how-to-use-websql-with-ionic/90994>\
**Category:** ionic-v3\
**Created:** [May 19, 2017, 4:48pm UTC](https://forum.ionicframework.com/t/how-to-use-websql-with-ionic/90994 "2017-05-19T16:48:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rashmi1995](https://avatars.discourse-cdn.com/v4/letter/r/0ea827/32.png) [@rashmi1995](https://forum.ionicframework.com/u/rashmi1995)\
**Post date:** [May 19, 2017, 4:48pm UTC](https://forum.ionicframework.com/t/how-to-use-websql-with-ionic/90994/1 "2017-05-19T16:48:34Z")

</div>

As per in the given document [https://ionicframework.com/docs/storage/](https://ionicframework.com/docs/storage/) " When running in a native app context, Storage will prioritize using SQLite, as it’s one of the most stable and widely used file-based databases, and avoids some of the pitfalls of things like localstorage and IndexedDB, such as the OS deciding to clear out such data in low disk-space situations.

When running in the web or as a Progressive Web App, Storage will attempt to use IndexedDB, WebSQL, and localstorage, in that order.".

The SQLite plugin is working fine in the device but during the ionic serve I expected the table should be formed in websql. but to my suprise it is not formed and the data is inserted and I am not seeing any error in my console regarding. Kindly correct me if my understandings are wrong.

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [May 19, 2017, 8:45pm UTC](https://forum.ionicframework.com/t/how-to-use-websql-with-ionic/90994/2 "2017-05-19T20:45:24Z")

</div>

> [@rashmi1995](#):
>
> I expected the table should be formed in websql

IndexedDB makes a sad face, because you didn’t think it was up to the task.

---

<div class="post-metadata">

**Author:** ![robertodebarba](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/robertodebarba/32/105994_2.png) [@robertodebarba](https://forum.ionicframework.com/u/robertodebarba)\
**Post date:** [May 19, 2017, 9:21pm UTC](https://forum.ionicframework.com/t/how-to-use-websql-with-ionic/90994/3 "2017-05-19T21:21:02Z")

</div>

What do you mean with “formed”?

Are you using a cordova plugin to access sqlite? Or the Ionic Storage API?  
Can you post some code?

---

<div class="post-metadata">

**Author:** ![rashmi1995](https://avatars.discourse-cdn.com/v4/letter/r/0ea827/32.png) [@rashmi1995](https://forum.ionicframework.com/u/rashmi1995)\
**Post date:** [May 21, 2017, 4:18pm UTC](https://forum.ionicframework.com/t/how-to-use-websql-with-ionic/90994/4 "2017-05-21T16:18:39Z")

</div>

I like to have a relational database in my application. So I thought of websql.

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [May 21, 2017, 7:50pm UTC](https://forum.ionicframework.com/t/how-to-use-websql-with-ionic/90994/5 "2017-05-21T19:50:18Z")

</div>

> [@rashmi1995](#):
>
> I like to have a relational database

I’m confused. Didn’t we start out with you talking about the ionic-storage documentation? That’s not relational.
