Add Expo platform support to documentation

This commit is contained in:
Jen Garcia 2018-05-30 15:19:49 -04:00
parent 96bc227e52
commit ae1d3f8456
6 changed files with 23 additions and 10 deletions

View File

@ -16,6 +16,7 @@
[ ] `sqlite`
[ ] `sqljs`
[ ] `react-native`
[ ] `expo`
**TypeORM version:**

View File

@ -20,7 +20,7 @@
<br>
</div>
TypeORM是一个[ORM](https://en.wikipedia.org/wiki/Object-relational_mapping)框架它可以运行在NodeJS、浏览器、Cordova、PhoneGap、Ionic、React Native和Electron平台上可以与TypeScript和JavaScript (ES5, ES6, ES7)一起使用。
TypeORM是一个[ORM](https://en.wikipedia.org/wiki/Object-relational_mapping)框架它可以运行在NodeJS、浏览器、Cordova、PhoneGap、Ionic、React Native、Expo和Electron平台上可以与TypeScript和JavaScript (ES5, ES6, ES7)一起使用。
它的目标是始终支持最新的JavaScript特性并提供额外的特性以帮助你开发任何使用数据库的应用程序 —— 不管是只有几张表的小型应用还是拥有多数据库的大型企业应用。
不同于现有的所有其他JavaScript ORM框架TypeORM支持Active Record和Data Mapper模式这意味着你用最有效的方法编写高质量的、松耦合的、可扩展的、可维护的应用程序。
@ -59,7 +59,7 @@ TypeORM 的一些特性:
- json / xml / yml / env格式的连接配置
- 支持 MySQL / MariaDB / Postgres / SQLite / Microsoft SQL Server / Oracle / sql.js
- 支持 MongoDB NoSQL 数据库
- 在NodeJS / 浏览器 / Ionic / Cordova / React Native / Electron平台上工作
- 在NodeJS / 浏览器 / Ionic / Cordova / React Native / Expo / Electron平台上工作
- 支持 TypeScript 和 JavaScript
- 产生出高性能、灵活、清晰和可维护的代码
- 遵循所有可能的最佳实践
@ -228,7 +228,7 @@ npm install typeorm -g
typeorm init --name MyProject --database mysql
```
`name`即项目的名称,`database`是你将使用的数据库。数据库可以是下列值之一:`mysql``mariadb``postgres``sqlite``mssql``oracle``mongodb``cordova``react-native`
`name`即项目的名称,`database`是你将使用的数据库。数据库可以是下列值之一:`mysql``mariadb``postgres``sqlite``mssql``oracle``mongodb``cordova``react-native``expo`
该命令将在`MyProject`目录中生成一个新项目,其中包含以下文件:
@ -511,7 +511,7 @@ createConnection({
}).catch(error => console.log(error));
```
在例子里使用的是mysql你也可以选择其他数据库只需要简单修改driver选项里的数据库的类型就可以了比如mysql、mariadb、postgres、sqlite、mssql、oracle、cordova、react-native或mongodb
在例子里使用的是mysql你也可以选择其他数据库只需要简单修改driver选项里的数据库的类型就可以了比如mysql、mariadb、postgres、sqlite、mssql、oracle、cordova、react-native、expo或mongodb
同样可以修改host, port, username, password 以及database等设置。
把Photo实体加到数据连接的实体列表中所有需要在这个连接下使用的实体都必须加到这个列表中。

View File

@ -21,7 +21,7 @@
</div>
TypeORM is an [ORM](https://en.wikipedia.org/wiki/Object-relational_mapping)
that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native and Electron platforms
that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, Expo, and Electron platforms
and can be used with TypeScript and JavaScript (ES5, ES6, ES7, ES8).
Its goal is to always support the latest JavaScript features and provide additional features
that help you to develop any kind of application that uses databases - from
@ -69,7 +69,7 @@ Some TypeORM features:
* connection configuration in json / xml / yml / env formats
* supports MySQL / MariaDB / Postgres / SQLite / Microsoft SQL Server / Oracle / sql.js
* supports MongoDB NoSQL database
* works in NodeJS / Browser / Ionic / Cordova / React Native / Electron platforms
* works in NodeJS / Browser / Ionic / Cordova / React Native / Expo / Electron platforms
* TypeScript and JavaScript support
* produced code is performant, flexible, clean and maintainable
* follows all possible best practices
@ -240,7 +240,8 @@ typeorm init --name MyProject --database mysql
```
Where `name` is the name of your project and `database` is the database you'll use.
Database can be one of the following values: `mysql`, `mariadb`, `postgres`, `sqlite`, `mssql`, `oracle`, `mongodb`, `cordova`, `react-native`.
Database can be one of the following values: `mysql`, `mariadb`, `postgres`, `sqlite`, `mssql`, `oracle`, `mongodb`,
`cordova`, `react-native`, `expo`.
This command will generate a new project in the `MyProject` directory with the following files:
@ -535,7 +536,7 @@ createConnection({
We are using MySQL in this example, but you can use any other supported database.
To use another database, simply change the `type` in the options to the database type you are using:
mysql, mariadb, postgres, sqlite, mssql, oracle, cordova, react-native or mongodb.
mysql, mariadb, postgres, sqlite, mssql, oracle, cordova, react-native, expo, or mongodb.
Also make sure to use your own host, port, username, password and database settings.
We added our Photo entity to the list of entities for this connection.

View File

@ -10,6 +10,7 @@
* [`mssql` connection options](#mssql-connection-options)
* [`mongodb` connection options](#mongodb-connection-options)
* [`sql.js` connection options](#sqljs-connection-options)
* [`expo` connection options](#expo-connection-options)
* [Connection options example](#connection-options-example)
## What is `ConnectionOptions`
@ -457,6 +458,10 @@ See [SSL options](https://github.com/mysqljs/mysql#ssl-options).
* `location`: The file location to load and save the database to.
## `expo` connection options
* `database` - Name of the database. For example "mydb".
## Connection options example
Here is a small example of connection options for mysql:

View File

@ -8,7 +8,7 @@
* [Column types](#column-types)
* [Column types for `mysql` / `mariadb`](#column-types-for-mysql--mariadb)
* [Column types for `postgres`](#column-types-for-postgres)
* [Column types for `sqlite` / `cordova` / `react-native`](#column-types-for-sqlite--cordova--react-native)
* [Column types for `sqlite` / `cordova` / `react-native` / `expo`](#column-types-for-sqlite--cordova--react-native--expo)
* [Column types for `mssql`](#column-types-for-mssql)
* [`simple-array` column type](#simple-array-column-type)
* [`simple-json` column type](#simple-json-column-type)
@ -305,7 +305,7 @@ or
`tsvector`, `tsquery`, `uuid`, `xml`, `json`, `jsonb`, `int4range`, `int8range`, `numrange`,
`tsrange`, `tstzrange`, `daterange`, `geometry`, `geography`
### Column types for `sqlite` / `cordova` / `react-native`
### Column types for `sqlite` / `cordova` / `react-native` / `expo`
`int`, `int2`, `int8`, `integer`, `tinyint`, `smallint`, `mediumint`, `bigint`, `decimal`,
`numeric`, `float`, `double`, `real`, `double precision`, `datetime`, `varying character`,

View File

@ -3,6 +3,8 @@
* [NodeJS](#nodejs)
* [Browser](#browser)
* [Cordova / PhoneGap / Ionic apps](#cordova--phonegap--ionic-apps)
* [React Native](#react-native)
* [Expo](#expo)
* [NativeScript](#nativescript)
## NodeJS
@ -59,6 +61,10 @@ For an example how to use TypeORM in Cordova see [typeorm/cordova-example](https
## React Native
TypeORM is able to on React Native apps using the [react-native-sqlite-storage](https://github.com/andpor/react-native-sqlite-storage) plugin. For an example see [typeom/react-native-example](https://github.com/typeorm/react-native-example).
# Expo
TypeORM is able to run on Expo apps using the [Expo SQLite API](https://docs.expo.io/versions/latest/sdk/sqlite.html).
## NativeScript
In the next releases we are planning to support NativeScript platform as well.