Commit Graph

572 Commits

Author SHA1 Message Date
Sakib Hasan 88a333e4c8 Merge pull request #297 from strongloop/allow-db-creation-docker
Create database on the docker script
2017-06-14 15:39:20 -04:00
ssh24 c68b81cd6a Create database on the docker script 2017-06-14 15:17:52 -04:00
Biniam Admikew cfdcdda192 Merge pull request #288 from strongloop/fix/inq-null-parser
Handle null values in inq properly
2017-06-14 13:13:49 -04:00
biniam 134eeb24e2 Handle null vals properly
When converting null values
to database column values,
return null if column is
nullable, otherwise try
to cast it to the property
type, and if not, return
'null'.
2017-06-14 12:44:25 -04:00
Sakib Hasan 8a197cd147 Merge pull request #293 from strongloop/feature/add-case-sensitive-regex
Add case sensitive regex
2017-06-13 11:16:12 -04:00
ssh24 145d061e94 Allow case sensitive regex operation 2017-06-13 10:18:27 -04:00
Biniam Admikew 4077ae8864 Merge pull request #286 from strongloop/fix/geopoint-orientation
switch long and lat for geopoint type
2017-06-06 09:48:24 -04:00
biniam 3dad2bf4df switch long and lat for geopoint type
MySQL expects reverse order of latitude and longitude
from the way we use it in LoopBack, so switch the order
when saving and loading Point spatial type we use for
Point/GeoPoint.
2017-06-06 08:54:13 -04:00
Kevin Delisle 8dfe41b9b5 Merge pull request #287 from strongloop/enable-discovery-tests
Enable and fix discovery tests
2017-06-05 14:15:39 -04:00
Kevin Delisle c236eb068d discovery.test: fix discoverModels tests 2017-06-05 13:50:46 -04:00
Kevin Delisle 2397141544 4.1.1
* Add http status code translations for errors (Kevin Delisle)
 * Allow explicit data types (ssh24)
 * Revert "switch long and lat for geopoint type" (biniam)
 * switch long and lat for geopoint type (biniam)
 * Escape index names (#280) (Sakib Hasan)
 * Fix docker setup (#279) (Sakib Hasan)
 * Add docker setup (#278) (Sakib Hasan)
 * Adding support for fractional seconds. (Joost de Bruijn)
 * fix compare of foreign keys for autoupdate (#272) (Sergey Nosenko)
 * Update README.md (Antoine LA)
2017-06-01 11:34:54 -04:00
Kevin Delisle 904fa479cf Merge pull request #284 from strongloop/http-error-code-translations
Add http status code translations for errors
2017-05-31 17:08:27 -04:00
Kevin Delisle 7d2f0751f6 Add http status code translations for errors
Errors will now have their status codes set based on the error
message returned by the MySQL driver.
2017-05-31 17:02:09 -04:00
Sakib Hasan b67cd565ec Merge pull request #283 from strongloop/fix/honor-explicit-datatype
Allow explicit data types
2017-05-31 15:14:03 -04:00
ssh24 44083e43c1 Allow explicit data types
Override columnDataType function

Add test cases

Apply feedback

Use date type as explicit datatype
2017-05-31 14:42:53 -04:00
Biniam Admikew fc55994d8c Merge pull request #285 from strongloop/revert/geopoint-orientation
Revert "switch long and lat for geopoint type"
2017-05-31 10:58:34 -04:00
biniam 0187f0434b Revert "switch long and lat for geopoint type"
This reverts commit dd5bfb3f82.
2017-05-31 10:30:00 -04:00
Biniam Admikew 361f7585b0 Merge pull request #282 from strongloop/fix/geopoint-orientation
switch long and lat vals for mysql
2017-05-30 09:43:12 -04:00
biniam dd5bfb3f82 switch long and lat for geopoint type 2017-05-30 09:29:36 -04:00
Sakib Hasan 2ba88203f3 Escape index names (#280)
* Escape index names

* Add test cases
2017-05-19 11:57:06 -04:00
Sakib Hasan 18ddc84929 Fix docker setup (#279)
* Add support for host and database

* Order the optional parameters correctly
2017-05-15 13:38:30 -04:00
Sakib Hasan a45e22eeb8 Add docker setup (#278)
* Add docker setup

Add a setup script that spawns a docker container before running test
Easy for contributors now to test, no need for a local instance

* Update readme with docs on running test

* Allow check for container status

Check for if the container is up before proceeding

* Add options for customized user,pass,port

* Fix seeding on database

Only seed the database if user specifies CI=true
OR when the tests actually run on the CI

* Update readme with windows env var
2017-05-12 10:13:15 -04:00
Janny eefa6813c6 Merge pull request #274 from joostdebruijn/feature/fractional-seconds
Adding support for fractional seconds
2017-05-08 11:04:06 -04:00
Joost de Bruijn c3a336c18d Adding support for fractional seconds. 2017-05-05 19:15:41 -04:00
Sergey Nosenko 72abcb8e9f fix compare of foreign keys for autoupdate (#272)
* fix compare of foreign keys for autoupdate

use mysql table name in case it is not equal model name

* fix column name lookup for fk definition

* fix ADD CONSTRAINT for multiple fk

if more the one foreign key added ADD CONSTRAINT
must be separated with comma but not with space as applySqlChanges do.

* fix duplicate foreign key creation on autoupdate

* fix entity name selection

* change join to toString as requested

* fix removing dropped keys

* fix linter issues

* add test case with columnName in foreign key

and isActual check after autoupdate

* uncommit accitenally commited test case
2017-05-05 19:13:23 -04:00
Diana Lau 204242663e Merge pull request #276 from monsty/patch-1
Update README.md
2017-05-05 10:11:31 -04:00
Antoine LA 41e5811481 Update README.md 2017-05-04 16:48:46 +02:00
Kevin Delisle 57e76e6fc9 4.1.0
* Tests for datetime types (Kevin Delisle)
 * Add new type DateString to fromColumnValue (Buck Bito)
 * Remove String manipulations of Date objects (Buck Bito)
 * Properties with mysql custom "columnName" don't get autoupdated (#273) (Sergey Nosenko)
 * Revert PR #257 (#266) (Sakib Hasan)
 * Fix async.each in migration (#262) (Benjamin Schuster-Boeckler)
 * refactor date, timestamp and datetime data types handling (#257) (Sergey Nosenko)
 * Fix too many connection error (#261) (Sakib Hasan)
2017-05-02 18:35:55 -04:00
Kevin Delisle 3fa5306970 Merge pull request #271 from bbito/bb-fresh-master
Remove String manipulations of Date objects
2017-05-02 18:23:52 -04:00
Kevin Delisle 31a7728dd0 Tests for datetime types 2017-05-02 17:46:21 -04:00
Buck Bito cee6303454 Add new type DateString to fromColumnValue
To sync with loopback-datasource-juggler #1356
which introduces new Type: DateString
2017-05-01 19:38:41 -04:00
Buck Bito d0a88ef045 Remove String manipulations of Date objects
This commit contains all previous work after rebase went badly
RE: Pull Request requested by @kjdelisle regarding #149 following my
proposed solution "A" at #149 (comment).
As mentioned in the post linked above, this change allows the
underlying mysqljs/mysql module to handle Date object serialization
and removes the forced conversion of Dates to UTC Strings.
An opt-out fallback to forced coercion to UTC is included,
which was modeled after #265 from @darknos .

Old, squashed commits:
d0ea1d926eae04d0355109c87eef4eeec173f887
Legacy UTC date processing fallback credit: @darknos

a59dad7d7bd945895fb410a963cf5932b6a20f9e
Remove orphaned string functions

e8fdbdcfd4092f3d9e018f688d14def3e3ca9856
Incorporate @darknos expanded check for zero dates

abd4e0a7e9122f857974678a6b6ad87a19988f6f
Remove DATE manipulations in from/toColumnValue
2017-04-28 16:13:15 -04:00
Sergey Nosenko ea33f557ab Properties with mysql custom "columnName" don't get autoupdated (#273)
* #250 fix column escaping for autoupdate

* Fix lint error
2017-04-27 17:31:20 -04:00
Sakib Hasan 345492e5b2 Revert PR #257 (#266) 2017-04-24 16:19:33 -04:00
Benjamin Schuster-Boeckler 70f0acadd4 Fix async.each in migration (#262) 2017-04-18 12:48:55 -04:00
Sergey Nosenko f2f0dac69d refactor date, timestamp and datetime data types handling (#257)
* refactor date, timestamp, datetime data-type

* reverse datatypes.test.js changes

* checking property.mysql.dataType

along with property.dataType for timestamp fields

* Fix PR linter

* moved test cases all under one test file

remove unnecessary test cases, unify setup procedures

* Fix sql mode before migration

Set sql mode to allow zero's on timestamp
Clean up code

* remove test cases with strings and DATE field type

* code cleanup as requested

* add accidentally deleted assert.ok(found)

* fix timeZone to timezone case in README.md

* Update readme with date type info
2017-04-18 10:13:46 -04:00
Sakib Hasan aa15ee553a Fix too many connection error (#261)
Disconnect db instance on TX test which makes multiple pool connection
2017-04-17 16:16:59 -04:00
Kevin Delisle f9ab75c1d9 4.0.0
* Replicate new issue_template from loopback (Siddhi Pai)
 * Replicate issue_template from loopback repo (Siddhi Pai)
 * fix linting problems (juanra)
 * Extract functions to base connector (ssh24)
 * Refactor alter table (ssh24)
 * Typo on README (#236) (Ctibor Laky)
 * Return if column is generated or not (#198) (Christiaan Westerbeek)
 * Upgrade to loopback-connector@4.x (Loay)
 * Refactor migration methods (ssh24)
 * Refactor Discovery Methods (Loay)
 * Remove old TODO and commented out code (Matthew Dickinson)
 * Fix autoupdate to create foreign keys after tables (Matthew Dickinson)
 * Add logging for errors encountered in discovery (Matthew Dickinson)
 * Update signature for alterTable (Matthew Dickinson)
 * Limit foreign key creation current connector (Matthew Dickinson)
 * Fix linting error (Matthew Dickinson)
 * Added test to validate foreign key handling (Matthew Dickinson)
 * Update foreign key creation table name handling (Matthew Dickinson)
 * Update alterTable to actually drop constraints (Matthew Dickinson)
 * Add rough handling for automatic foreign keys (Matthew Dickinson)
 * remove line not needed (#237) (ivy ho)
 * Update LB-connector version (Loay)
2017-03-31 17:36:48 -04:00
siddhipai 3b2854045a Merge pull request #240 from strongloop/replicate-issue-template
Replicate issue_template from loopback repo
2017-03-28 14:53:41 -07:00
Siddhi Pai e1502baf31 Replicate new issue_template from loopback 2017-03-22 17:09:40 -04:00
Siddhi Pai 0c677e59e3 Replicate issue_template from loopback repo 2017-03-22 17:09:40 -04:00
Sakib Hasan f550caae0e Merge pull request #227 from juanramb/fix-blob
Fix wrong values in mysql after saving buffer fields
2017-03-21 07:08:44 -04:00
juanra a8e22c5bff fix linting problems 2017-03-21 10:45:24 +01:00
Sakib Hasan 2fc14154c7 Merge pull request #252 from strongloop/fix/refactor-fns
Extract functions to base connector
2017-03-20 11:36:18 -04:00
ssh24 dc1e0d8050 Extract functions to base connector
move getAddModifyColumns and getDropColumns to base
2017-03-20 10:34:47 -04:00
Sakib Hasan e81de01aa6 Merge pull request #251 from strongloop/refactor-alter-table
Refactor alter table
2017-03-17 17:42:30 -04:00
ssh24 a02047b643 Refactor alter table
Include fk with autoupdate/migrate

Some tests are failing due to timeout, looking into it
should check actuality of dataSource fails, looking into it

Fix actuality of ds test

Fix autoupdate test timeout

Fix requested changes

Fix to checkOnly for isActual
2017-03-17 17:21:10 -04:00
Ctibor Laky 04665277b7 Typo on README (#236)
* typo
2017-03-10 06:50:59 -05:00
Christiaan Westerbeek b67b57970f Return if column is generated or not (#198)
* Return if column is generated or not

Related to
https://github.com/strongloop/loopback-datasource-juggler/issues/899

* add pk for testgen table

* Fixe the double quotes around generated

as requested by @loay

* Fix commit linter

Block must not be padded by blank lines padded-blocks

* Code fixes to follow guide

* Should fix the tests failing

Test failing on the tableName (incorrect case)
2017-03-08 18:56:27 -05:00
Loay fa0e5b46c6 Merge pull request #249 from strongloop/feature/upgrade-to-connector-4.x
Upgrade to loopback-connector@4.x
2017-03-06 19:22:14 -05:00