
Expo sqlite tutorial code#
However, in React Native, the code is usually minified in order to reduce the file size of the final application. TypeORM relies a lot on the class and prop names to work and that's not really a concern on the backend, since the code is not really bundled or minified in that context. Now the changes should persist in the database when you turn the application off and back on!Įven though the app has been working just fine until now on development mode, it will not once it's published with expo publish or built into a standalone App. If you want to use the latest version instead of 0.2.28, you can just remove the version specification from the following command. This should fix the RegEx related problems when using the query builder / repository APIs. The engine that Expo uses to run JavaScript doesn't support these lookbehinds and that is what is causing the problem.įor more information, please refer to the main issue in the TypeORM repository.ĮDIT: So as of February 8th, 2021 the 0.2.31 version of TypeORM is now available. Since the Repository depends directly on it, that's basically the entire library functionality broken. This prevents you from being able to use the QueryBuilder object. The one important thing here is that, as of the making of this article, only versions prior to 0.2.28 of TypeORM can be used with Expo.īasically there's an issue with a new feature introduced in version 0.2.29 which uses RegEx lookbehinds. All it does is present the text and add a line-through decoration in case it gets toggled. P.S.: The Todo component is very trivial. With that being presented, the focus is to give this application a persistence layer that will save all To-Dos and their current state to a local in-device database. The version prior to the persistence layer implementation can be found in this branch of the article's repository.

FC = () => Įnter fullscreen mode Exit fullscreen mode The items can be toggled on/off, deleted and there is an input to create a new item:Ĭonst TodoList : React.

The main component will hold a state for a list of To-Dos. The application we'll be working on in this article is as simple as it can be.

if at any point you feel lost please refer to the repository.if the structure chosen for the project ever feels excessive, it's because I'm aiming to keep it organized and give it scalability.
Expo sqlite tutorial how to#
Expo sqlite tutorial driver#
Luckily, TypeORM already offers an expo driver and it's setup looks very easy. With that in mind and having had some experience with TypeORM on the backend before, I wanted to see what it would be like to combine the two. Although Expo offers a SQLite local database connection API, it is not very practical to use, especially for larger projects with more complex database designs since all it has is an execute function where you can write raw queries to be ran.
