Commit Graph

66 Commits

Author SHA1 Message Date
Miroslav Bajtoš b871f603b6 Remove peer dependency on datasource-juggler
Use `SqlConnector` from loopback-connector as the base class for the
MySQL connector.

Use `dataSource.modelBuilder` instead of `juggler.ModelBuilder` to
access the function for registering new schema type.

Note: the behaviour remains backwards compatible, the connector can be
used with both old 1.x and upcoming 2.x versions of
loopback-datasource-juggler.
2014-06-03 08:46:52 +02:00
Raymond Feng 51bf6e1034 Fix sql injection and add test cases 2014-05-30 15:15:27 -07:00
Raymond Feng b9e4b64848 Fix the varchar length 2014-05-29 15:45:25 -07:00
Raymond Feng a41c7f5c7a Add like/nlike support 2014-05-29 15:16:14 -07:00
Raymond Feng 33b86b51b2 Fix object/json type mapping 2014-05-25 09:46:55 -07:00
Raymond Feng 7332f12972 Fix buildWhere 2014-05-15 10:32:31 -07:00
Raymond Feng 1103a9e919 Add support for logical operators (AND/OR) 2014-05-14 21:21:00 -07:00
Scott Anderson 0a619fb263 updateOrCreate assumes numeric primary key(s)
I removed the check to see if a property is an ID field while building the
values clause to allow it to work if primary key(s) are strings.
2014-04-16 16:37:28 -04:00
Raymond Feng 3165cb8bcd Remove the commented out code 2014-04-08 10:47:00 -07:00
Raymond Feng fa003bb267 Fix the table generation for string ids 2014-04-07 22:16:26 -07:00
Raymond Feng f6a370921d Merge pull request #19 from vectart/master
Prevent inserting undefined values
2014-03-21 08:46:09 -07:00
Raymond Feng 8f5b09ba64 Use NULL for undefined 2014-03-21 08:35:04 -07:00
Marat Dyatko 91116f32db Prevent inserting undefined values
The following SQL query was executed:

INSERT INTO `cv` (`first_name`, `last_name`, `father_name`, `city`, `district`, `transfer`, `nationality`, `email`, `icq`, `skype`, `birth_date`, `marital_status`, `gender`, `children_status`, `id`) VALUES ('asdsd', , , '', '', , , 'i@marat.by', , , , , , , 2) ON DUPLICATE KEY UPDATE `first_name` = 'asdsd', `last_name` = undefined, `father_name` = undefined, `city` = '', `district` = '', `transfer` = undefined, `nationality` = undefined, `email` = 'i@marat.by', `icq` = undefined, `skype` = undefined, `birth_date` = undefined, `marital_status` = undefined, `gender` = undefined, `children_status` = undefined;
2014-03-08 19:44:49 +01:00
Raymond Feng e54aa56cee Reformat code 2014-02-12 16:57:06 -08:00
Raymond Feng ae488942bb Fix the orderBy 2013-12-05 16:08:32 -08:00
Raymond Feng 22b9e78692 Refactor the runQuery logic into a function 2013-11-27 09:08:03 -08:00
Raymond Feng f171e74392 Improve the connector based on review feedbacks
Introduce a 'createDatabase' option to allow DB to created
Wrap the callback with connection.release
Fix typo
2013-11-27 08:42:40 -08:00
Raymond Feng aac933c39d Allow connectionLmit to be set 2013-11-26 18:50:56 -08:00
Raymond Feng 999825abea Use connection pool for MySQL 2013-11-26 17:40:31 -08:00
Raymond Feng 03cec48c85 Fix the regression caused by juggler 2013-11-20 10:54:01 -08:00
Raymond Feng 20305878d2 Fix the property mapping for return values 2013-10-22 11:25:17 -07:00
Raymond Feng 2ce81681d6 Use the columnEscaped for names 2013-10-14 14:32:19 -07:00
Raymond Feng 84b38b75cc Allow custom engine and column types 2013-10-08 13:44:58 -07:00
Raymond Feng 9e2879201b Map MySQL Point to GeoPoint 2013-10-07 14:54:26 -07:00
Raymond Feng 36884820fc Map GeoPoint to POINT, add more debug information 2013-10-07 14:46:05 -07:00
Raymond Feng 6b6e9144ed Add docs for README and js code 2013-10-03 14:50:38 -07:00
Raymond Feng 03840898dd Supports ',' as the delimeter 2013-08-30 08:51:32 -07:00
Raymond Feng dfa995eb17 Add aliases for some properties 2013-08-21 13:37:01 -07:00
Raymond Feng 1c648b0faf Add an optional where object for delete 2013-08-18 10:04:58 -07:00
Raymond Feng 90a3450488 Add optional models argument to autoupdate 2013-08-08 08:35:29 -07:00
Raymond Feng 9daf9ef91c Rename 'loopback-data' to 'loopback-datasource-juggler' 2013-07-30 14:21:10 -07:00
Raymond Feng 382f99b9c6 Rename schema/adapter to be dataSource/connector 2013-07-23 12:47:02 -07:00
Raymond Feng 9674a0308e Bring up the test cases 2013-07-21 17:27:54 -07:00
Raymond Feng fb375fdcc8 Enable discovery 2013-07-21 10:36:26 -07:00
Raymond Feng 1329b40073 Start to add discovery 2013-07-20 23:38:40 -07:00
Raymond Feng 275405521b Migrate to loopback-data 2013-07-20 22:37:59 -07:00
dgsan e109adc737 Merge pull request #41 from gierschv/fix-boolean
Fixes boolean conversion when fetching data from database
2013-06-28 11:46:37 -07:00
Vincent Giersch 6fa023250b Fixes boolean conversion when fetching data from database 2013-06-28 17:44:12 +01:00
Vincent Giersch b91d2cf241 Fixes variable name 2013-06-28 17:34:25 +01:00
dgsan 4bf7bcd2b3 After feedback changed Enum implementation to be a function.
The main side effect is that the `Enum` type can't be registered.
Use `EnumFactory()` to build an `Enum`.
2013-06-18 10:36:05 -07:00
dgsan c1616fd998 Support for Enum type in MySQL adapter. Requires patch to mainline JDB.
(See pull request: https://github.com/1602/jugglingdb/pull/296.)

After this there are several ways to use Enum with the adapter as shown in datatypes.test.js.
2013-06-17 14:25:57 -07:00
dgsan b04d9466ef Merge https://github.com/jugglingdb/mysql-adapter
* https://github.com/jugglingdb/mysql-adapter:
  Update README.md
  Fixed typo in the require statement
  0.0.1-6
  Add checking for undefined in buildWhere
  Fix injection
2013-06-13 09:41:35 -07:00
dgsan bcee504d77 Proper tests and support for connection collation/charset. Added semicov as a dev dependency because of how tests are run. 2013-06-13 09:34:31 -07:00
dgsan 3e90d39691 Merge pull request #33 from dgsan/master
Initial support of additional column types and connection collation/charset settings.
2013-06-04 15:01:43 -07:00
dgsan 8b7ac18cc3 Support for local MySQL dataTypes via the dataType model field option.
Support for setting collation/charset at the schema level.

Porting of non-running migration test to new test running layout.

Resolves issue #19. Resolves issue #28. Resolves issue #17.

Should allow for changing the types for particular columns (Int, SmallInt, BigInt, Text, Char, Float, etc.).
This seems to work with the current migration test, however use of floats and such in model instances has not been heavily tested.

Likewise, in porting migration the full suite of index migration tests has yet to be ported.
Likewise, issue with dropping columns from a model persists and seems related to `defineProperty` in JDB core choking when used to try and undefine.
2013-06-04 14:34:23 -07:00
dgsan 7ffbb1f4a4 Merge pull request #32 from dgsan/master
Resolves #31, #15
2013-05-30 13:51:11 -07:00
dgsan 9291cbafdc Resolves issues #31, #15. 2013-05-30 13:43:01 -07:00
Anatoliy Chakkaev 6c5666e23e Add checking for undefined in buildWhere 2013-04-22 08:40:12 +04:00
Anatoliy Chakkaev 400614a8c9 Fix injection 2013-04-18 22:58:21 +04:00
dgsan d7112909eb Fixes #21
Changed param for using offset with limit to 'skip' so as to match JDB core.
(Unit test to be pushed to JDB core.)
2013-04-18 09:11:03 -07:00