GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - typeorm/ionic-example: Example project to demonstrate TypeORM in an Ionic app

This repository was archived by the owner on Apr 24, 2026. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

34 Commits
34 Commits

Folders and files

NameName
Last commit message
Last commit date
config
config
 
 
resources
resources
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
config.xml
config.xml
 
 
ionic.config.json
ionic.config.json
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
screenshot.png
screenshot.png
 
 
tsconfig.json
tsconfig.json
 
 
tslint.json
tslint.json
 
 

Repository files navigation

Using TypeORM in an Ionic project

You can use TypeORM in connection with the cordova-sqlite-storage plugin in your Ionic app. This project demonstrates how that would work.

Installation

To run this example in production or development mode you have to make sure, ionic and cordova are installed globally on your machine. After that you can install all necessary dependencies for running this example.

  1. Check if npm is installed. Otherwise please install node.js and npm.
npm -v
  1. Install ionic and cordova command line interface globally.
npm install -g cordova ionic
  1. Install all dependencies listed in package.json.
npm install

Running the example in your browser

ionic serve

Running the example on your device

  1. Add an iOS or Android to the project.
ionic cordova platform add ios 
# or 
ionic cordova platform add android
  1. Run the app on your device.
ionic cordova run ios
# or
ionic cordova run android

For further information please read ionic's deployment guide.

screenshot

Using TypeORM in your own app

  1. Install the plugin
ionic cordova plugin add cordova-sqlite-storage --save
  1. Install TypeORM
npm install typeorm --save
  1. Install node.js-Types
npm install @types/node --save-dev
  1. Add "typeRoots": ["node_modules/@types"] to your tsconfig.json under compilerOptions

  2. Create a custom webpack config file like the one included in this project to use the correct TypeORM version and add the config file to your package.json (Required with TypeORM >= 0.1.7)

Limitations to TypeORM when using production builds

Since Ionic make a lot of optimizations while building for production, the following limitations will occur:

  1. Entities have to be marked with the table name (eg @Entity('table_name'))

  2. getRepository() has to be called with the name of the entity instead of the class (eg getRepository('post') as Repository<Post>)

  3. Date fields are not supported:

@Column()
birthdate: Date;

About

Example project to demonstrate TypeORM in an Ionic app

Resources

Readme
Activity
Custom properties

Stars

66 stars

Watchers

7 watching

Forks

56 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.