Skip to content

Commit 88effcf

Browse files
committed
Deploying to gh-pages from @ 825bf2c 🚀
1 parent 825bf2c commit 88effcf

File tree

6 files changed

+0
-588
lines changed

6 files changed

+0
-588
lines changed
Lines changed: 0 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -1,166 +0,0 @@
1-
# loopback-connector-db2
2-
3-
[IBM® DB2®](http://www.ibm.com/analytics/us/en/technology/db2/) is the database of choice for robust, enterprise-wide solutions handling high-volume workloads.
4-
It is optimized to deliver industry-leading performance while lowering costs. The `loopback-connector-db2` module is the LoopBack connector for DB2.
5-
6-
The LoopBack DB2 connector supports:
7-
8-
- All [create, retrieve, update, and delete operations](http://loopback.io/doc/en/lb2/Creating-updating-and-deleting-data.html).
9-
- [Queries](http://loopback.io/doc/en/lb2/Querying-data.html) with fields, limit, order, skip and where filters.
10-
- All supported DB2 LUW versions.
11-
12-
## Installation
13-
14-
Enter the following in the top-level directory of your LoopBack application:
15-
16-
```
17-
$ npm install loopback-connector-db2 --save
18-
```
19-
20-
The `--save` option adds the dependency to the application's `package.json` file.
21-
22-
## Configuration
23-
24-
Use the [data source generator](http://loopback.io/doc/en/lb3/Data-source-generator.html) to add the DB2 data source to your application.
25-
The entry in the application's `server/datasources.json` will look something like this:
26-
27-
```js
28-
"mydb": {
29-
"name": "mydb",
30-
"connector": "db2"
31-
}
32-
```
33-
34-
Edit `server/datasources.json` to add other supported properties as required:
35-
36-
```js
37-
"mydb": {
38-
"name": "mydb",
39-
"connector": "db2",
40-
"username": <username>,
41-
"password": <password>,
42-
"database": <database name>,
43-
"hostname": <db2 server hostname>,
44-
"port": <port number>
45-
}
46-
```
47-
48-
The following table describes the connector properties.
49-
50-
Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Type&nbsp;&nbsp; | Description
51-
---------------| --------| --------
52-
database | String | Database name
53-
schema | String | Specifies the default schema name that is used to qualify unqualified database objects in dynamically prepared SQL statements. The value of this property sets the value in the CURRENT SCHEMA special register on the database server. The schema name is case-sensitive, and must be specified in uppercase characters
54-
username | String | DB2 Username
55-
password | String | DB2 password associated with the username above
56-
hostname | String | DB2 server hostname or IP address
57-
port | String | DB2 server TCP port number
58-
useLimitOffset | Boolean | LIMIT and OFFSET must be configured on the DB2 server before use (compatibility mode)
59-
supportDashDB | Boolean | Create ROW ORGANIZED tables to support dashDB.
60-
dsn | String | DSN string; can be used instead of the username, password, database, hostname and port properties
61-
maxPoolSize | Number | Maximum number of connections in the connection pool
62-
63-
64-
Alternatively, you can create and configure the data source in JavaScript code.
65-
For example:
66-
67-
```js
68-
var DataSource = require('loopback-datasource-juggler').DataSource;
69-
var DB2 = require('loopback-connector-db2');
70-
71-
var config = {
72-
username: process.env.DB2_USERNAME,
73-
password: process.env.DB2_PASSWORD,
74-
hostname: process.env.DB2_HOSTNAME,
75-
port: 50000,
76-
database: 'SQLDB',
77-
};
78-
79-
var db = new DataSource(DB2, config);
80-
81-
var User = db.define('User', {
82-
name: { type: String },
83-
email: { type: String },
84-
});
85-
86-
db.autoupdate('User', function(err) {
87-
if (err) {
88-
console.log(err);
89-
return;
90-
}
91-
92-
User.create({
93-
name: 'Tony',
94-
email: 'tony@t.com',
95-
}, function(err, user) {
96-
console.log(err, user);
97-
});
98-
99-
User.find({ where: { name: 'Tony' }}, function(err, users) {
100-
console.log(err, users);
101-
});
102-
103-
User.destroyAll(function() {
104-
console.log('example complete');
105-
});
106-
});
107-
```
108-
109-
## Running tests
110-
111-
### Own instance
112-
113-
If you have a local or remote DB2 instance and would like to use that to run the test suite, use the following command:
114-
- Linux
115-
```bash
116-
DB2_HOSTNAME=<HOST> DB2_PORTNUM=<PORT> DB2_USERNAME=<USER> DB2_PASSWORD=<PASSWORD> DB2_DATABASE=<DATABASE> DB2_SCHEMA=<SCHEMA> CI=true npm test
117-
```
118-
- Windows
119-
```bash
120-
SET DB2_HOSTNAME=<HOST>
121-
SET DB2_PORTNUM=<PORT>
122-
SET DB2_USERNAME=<USER>
123-
SET DB2_PASSWORD=<PASSWORD>
124-
SET DB2_DATABASE=<DATABASE>
125-
SET DB2_SCHEMA=<SCHEMA>
126-
SET CI=true
127-
npm test
128-
```
129-
130-
#### How to get a local DB2 instance:
131-
132-
- Go to [IBM DB2 trials](http://www.ibm.com/analytics/us/en/technology/db2/db2-trials.html) page.
133-
- Register for an account.
134-
- Download either IBM DB2 or IBM DB2 Express-C.
135-
- For documentation or more information about the installation or setup, see http://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.kc.doc/welcome.html
136-
137-
#### IBM DB2 Express-C scenario on Windows:
138-
- Run the setup file.
139-
- Set user information for the DB2 Administration server.
140-
- Write down the user information and the password that you create. User name is `db2admin` by default but it could be modified.
141-
- Configure DB2 instance and write down the port number. It is 50000 by default.
142-
- Once setup is done, Start the `default DB2 and Database Client Interface Selection Wizard`, and proceed with the configuration.
143-
- Ensure that the DB2 Data server runtime client is started. The default name is `DB2COPY1`.
144-
- Let's assume your database name is `sample`, and schema name is `STRONGLOOP`.
145-
- In Windows, start the DB2 Command window-Administrator (In Mac or Linux, use terminal with proper privileges).
146-
- Make sure that you are in this path `...\IBM\SQLLIB\BIN` (In mac, it should be ` /Users/<userid>/sqllib\bin`), and type the following commands:
147-
148-
```
149-
>set db2instance=server1
150-
151-
>db2 connect to sample
152-
153-
>db2 set schema to STRONGLOOP
154-
```
155-
156-
### Docker
157-
If you do not have a local DB2 instance, you can also run the test suite with very minimal requirements.
158-
- Assuming you have [Docker](https://docs.docker.com/engine/installation/) installed, run the following script which would spawn a DB2 instance on your local:
159-
```bash
160-
source setup.sh <HOST> <PORT> <PASSWORD> <DATABASE>
161-
```
162-
where `<HOST>`, `<PORT>`, `<PASSWORD>` and `<DATABASE>` are optional parameters. By default, the user is `db2inst1`.
163-
- Run the test:
164-
```bash
165-
npm test
166-
```
Lines changed: 0 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +0,0 @@
1-
# loopback-mixins-example
2-
3-
**⚠️ This LoopBack 3 example project is no longer maintained. Please refer to [LoopBack 4 Examples](https://loopback.io/doc/en/lb4/Examples.html) instead. ⚠️**
4-
5-
```
6-
$ git clone https://github.com/strongloop/loopback-example-mixins
7-
$ cd loopback-example-mixins
8-
$ npm install
9-
$ npm start
10-
```
11-
12-
This example is a LoopBack project that uses the mixin functionality available in [loopback-boot](https://github.com/strongloop/loopback-boot/) as of [v2.8.0](https://github.com/strongloop/loopback-boot/tree/v2.8.0).
13-
14-
This example application shows mixins loading from several different locations like directories and modules as well as performing different actions like observing changes and adding model attributes. This README covers the mixin changes in both the model config and model definition.
15-
16-
## Mixin Loading
17-
18-
Specify mixin locations relative to the `server/model-config.json` file. Multiple mixins can exist in a single directory. Once specified in the `model-config.json` file the mixin will be available in the LoopBack mixin registry but still needs to be configured for use in the model.
19-
20-
### npm module
21-
22-
This loads the [loopback-ds-timestamp-mixin](https://www.npmjs.com/package/loopback-ds-timestamp-mixin) module from the top level `node_modules` directory. Note that this module provides a mixin file `time-stamp.js` which is registered as the camel case `TimeStamp` name.
23-
24-
```js
25-
{
26-
"_meta": {
27-
...
28-
"mixins": [
29-
...
30-
"../node_modules/loopback-ds-timestamp-mixin"
31-
]
32-
}
33-
}
34-
```
35-
36-
### The `common/mixins/` directory
37-
38-
```js
39-
{
40-
"_meta": {
41-
...
42-
"mixins": [
43-
...
44-
"../common/mixins"
45-
]
46-
}
47-
}
48-
```
49-
50-
### The local `server/mixins/` directory
51-
52-
Because the `model-config.json` is within the `server` directory this loads the mixins from current mixins directory.
53-
54-
```js
55-
{
56-
"_meta": {
57-
...
58-
"mixins": [
59-
...
60-
"./mixins"
61-
]
62-
}
63-
}
64-
```
65-
66-
## Model config
67-
68-
In the model description file you must activate the mixin from the group you have loaded. In this application the `common/models/dog.json` file activates several mixins by adding them to the mixin object definition.
69-
70-
```js
71-
{
72-
"name": "Dog",
73-
"base": "PersistedModel",
74-
...
75-
"mixins": {
76-
"TimeStamp": true,
77-
"Tag": true,
78-
"Squirrel": true
79-
}
80-
}
81-
```
82-
83-
Mixins also have the ability to pass in options through this activation by using an object instead of `true`. These options are implemented by the mixin themselves, see the documentation provided by the mixin for more information on available options.
84-
85-
```js
86-
{
87-
"name": "Dog",
88-
"base": "PersistedModel",
89-
...
90-
"mixins": {
91-
"TimeStamp": {
92-
"required" : false
93-
},
94-
"Tag": true,
95-
"Squirrel": true
96-
}
97-
}
98-
```
99-
100-
---
101-
102-
[More LoopBack examples](https://loopback.io/doc/en/lb3/Tutorials-and-examples.html)
Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +0,0 @@
1-
# LoopBack Guide Application (for iOS)
2-
3-
The LoopBack Guide Application provides an easy-to-digest example application
4-
from UI to data and back again.
5-
6-
## Installation
7-
8-
The Guide assumes you have [XCode][xcode] installed and a running LoopBack application.
9-
10-
1. Clone the Guide Application: `git clone https://github.com/strongloop/loopback-guide-app`.
11-
1. Open the project: `open loopback-guide-app/LoopBackGuideApplication/LoopBackGuideApplication.xcodeproj/`.
12-
1. Now in XCode, run the Application with `Cmd+R`.
13-
14-
## Using the Guide
15-
16-
Once you have the Guide running, flip through the pages and familiarize yourself
17-
with what the app does. From there, dive into the Objective-C and see _how_ it
18-
does it. There are comments for everything.
19-
20-
## Questions?
21-
22-
Check out the [Developer forum on Google Groups](https://groups.google.com/forum/#!forum/loopbackjs).
23-
24-
---
25-
26-
[More LoopBack examples](https://loopback.io/doc/en/lb3/Tutorials-and-examples.html)

0 commit comments

Comments
 (0)