Matthew Dickinson
0b04d461e4
Update signature for alterTable
...
Since alterTable is semi-public, the method now checks the arugments to
make sure that it still supports the old signature that doesn't include
actualFks
2017-02-17 11:25:19 -05:00
Matthew Dickinson
d461d07f34
Limit foreign key creation current connector
...
Updated fk generation to make sure that it doesn't try to create
foreign keys linking to another DB/connector
2017-02-17 11:25:19 -05:00
Matthew Dickinson
4d20fa7746
Fix linting error
2017-02-17 11:25:19 -05:00
Matthew Dickinson
940032f4dd
Update foreign key creation table name handling
2017-02-17 11:25:19 -05:00
Matthew Dickinson
782959cf20
Update alterTable to actually drop constraints
2017-02-17 11:25:19 -05:00
Matthew Dickinson
1324333ffd
Add rough handling for automatic foreign keys
...
This handles basic creating/dropping of FKs based on model relations
2017-02-17 11:25:19 -05:00
Carl Fürstenberg
5383c4c0ff
Follow mysql recommendations for handling booleans
...
Per http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html
`BOOL` and `BOOLEAN` is alias for `TINYINT(1)` thus we should make
sure discover can handle as such.
Introducing three flags:
* treatCHAR1AsString
default false - treats CHAR(1) as a String instead of a Boolean
* treatBIT1AsBit
default true - treats BIT(1) as a Boolean instead of a Binary
* treatTINYINT1AsTinyInt
default true - treats TINYINT(1) as a Boolean instead of a Number
The default handling for CHAR(1) is legacy backward compability due to
custom to use a CHAR(1) to store 'Y', 'N', '0', '1', etc...
2017-01-11 19:44:50 -08:00
muhammad hasan
0f1b14b158
Fix expected column name when autoupdate
...
Fix mysql column name being ignored on dataType change or new column
being added
Fix mysql column name ignored if index changed
Add column name case on autoupdate test
Fix test case scheme error
Fix describe test
2016-12-12 10:06:18 -05:00
Loay Gewily
fce2207da3
Fix CI Failures
2016-12-07 23:53:46 -05:00
Ron Lloyd
a96d61fa9f
Autoupdate mysql.columnName bug fix
2016-09-13 22:21:11 -06:00
deepakrkris
22c1700af8
Fix to configure model index in keys field
...
This is a fix for issue 109,for model indexes not configured
per strongloop documentation
2016-08-15 12:51:56 -04:00
Raymond Feng
5fec12a00c
Merge pull request #179 from azatoth/zero_datetime
...
Add special handling of zero date/time entries
2016-08-11 09:03:14 -07:00
Loay
9c9b61e7dc
Update eslint infrastructure
2016-08-10 20:04:26 -04:00
Carl Fürstenberg
1ee79768f2
Add special handling of zero date/time entries
...
Per MySQL docs
(http://dev.mysql.com/doc/refman/5.7/en/date-and-time-types.html ):
"MySQL permits you to store a “zero” value of '0000-00-00' as a
“dummy date.” This is in some cases more convenient than using NULL
values, and uses less data and index space. To disallow '0000-00-00',
enable the NO_ZERO_DATE mode.
“Zero” date or time values used through Connector/ODBC are converted
automatically to NULL because ODBC cannot handle such values."
As we are not using Connector/ODBC we need to handle this ourself.
2016-07-29 14:59:24 +02:00
Candy
b55ae36e79
Add globalization
2016-07-28 17:20:03 -04:00
juehou
658635e72c
Add function connect
2016-05-12 15:56:48 -04:00
Ryan Graham
340a4eb0f6
insert/update copyright notices
2016-05-03 16:52:03 -07:00
juehou
12cf967b7b
Override other settings if url provided
...
Handle url in config
Override other settings if url provided
2016-04-06 23:31:23 -04:00
Amir Jafarian
f572f920a4
Implement ReplaceOrCreate
2016-01-15 19:12:38 -05:00
Diogo Correia
8569c9812a
Pass options to the execute command.
2015-10-11 17:08:25 +01:00
Simon Ho
22bebe3c4a
Add support for RegExp operator
2015-07-28 17:24:31 -07:00
Raymond Feng
1bfaf1a783
Start to add transaction support
2015-05-18 12:02:25 -07:00
Raymond Feng
c5d3b67bfe
Fix the typo
2015-05-14 08:39:36 -07:00
Raymond Feng
be54c1a407
Refactor the code to use base SqlConnector
2015-05-13 10:17:15 -07:00
Raymond Feng
f6e4c228eb
Return isNewInstance from upsert
2015-04-01 16:25:23 -07:00
Simon Ho
ff538b09c8
Return count when updating or deleting models
2015-03-26 11:26:41 -07:00
Raymond Feng
1d2dd5e9fb
Merge pull request #78 from strongloop/feature/allow-object-id
...
Allow models backed by MySQL to reference mongodb ObjectID
2015-03-09 15:55:43 -07:00
Raymond Feng
fbe9ee078d
Merge pull request #79 from partap/discovery-string-length
...
Query string length for schema in characters in addition to bytes
2015-03-09 15:55:24 -07:00
ulion
f316b8ca7d
Fix mysql neq for NULL value.
2015-03-08 22:57:36 +08:00
Partap Davis
0964a2634a
replace dataLength instead of adding length property
2015-03-07 20:09:10 -07:00
Raymond Feng
634a0a94bc
Allow models backed by MySQL to reference mongodb ObjectID
2015-03-04 22:55:33 -08:00
Partap Davis
1ee0c2f3bb
Query string length for schema in characters in addition to bytes
2015-03-02 15:10:19 -07:00
Raymond Feng
2422c4c6f0
Update deps
2015-02-20 16:15:15 -08:00
Raymond Feng
8b860890e8
Fix the loop of models
2015-01-15 14:21:49 -08:00
Raymond Feng
0116dbfa1c
Merge pull request #69 from glesage/feature/fix-missing-ok
...
Fixed missing 'ok' declaration
2015-01-15 14:11:49 -08:00
Geoffroy Lesage
0772223908
Set ok default to false
2015-01-15 16:09:47 -06:00
Geoffroy Lesage
0511830a12
Fixed missing 'ok'
2015-01-15 16:08:41 -06:00
Geoffroy Lesage
bc2dc4e6a2
Changed default type mapping
2015-01-15 15:59:50 -06:00
Raymond Feng
aa157b1050
Merge pull request #63 from glesage/feature/fix-isActual
...
Fixed isActual implemenation
2015-01-14 14:49:24 -08:00
Raymond Feng
de299aed9f
Merge pull request #60 from serkanserttop/fix-inherit-schema-from-datasource
...
Inherit Schema From DataSource if not defined
2015-01-14 14:48:22 -08:00
Raymond Feng
7fe8306db2
Use mysql.escape/escapeId()
2015-01-09 09:02:36 -08:00
Geoffroy Lesage
9d3ab6fc42
Fixed isActual syntax to accept optional model arg
2015-01-08 10:29:55 -06:00
Raymond Feng
5b6bc9cf83
Merge pull request #54 from saggiyogesh/master
...
Fix for unique index when declared in fields config
2015-01-06 10:17:38 -08:00
Geoffroy Lesage
e00b0ba8cf
Fixed isActual implemenation
2014-12-23 04:06:24 -06:00
Raymond Feng
a82fc3f9d2
Create 'NOT NULL' constraint for required or id properties
2014-12-03 14:10:21 -08:00
Raymond Feng
f9caaafe37
Better handle discovery of nullable columns
2014-12-03 14:09:52 -08:00
Serkan Serttop
78476b5a9a
Inherit Schema From DataSource if not defined
...
If owner is not set via json in the discovery process, use the database
schema defined in the dataSource setting.
2014-11-30 02:40:41 +02:00
cpentra1
7cf69dbcb9
fix(initialization): bug fix for setting limit on number of connections in connection pool
2014-11-21 00:58:02 -05:00
yogesh
6d5ad5e470
(cherry picked from commit a6d31e8)
2014-10-21 11:51:45 +05:30
Raymond Feng
04c10fdf03
Enhance error reporting for automigrate/autoupdate
2014-09-11 12:23:32 -07:00
Raymond Feng
8a0ccf3ce3
Use table name instead of model name
2014-09-10 23:45:27 -07:00
Raymond Feng
c35a00b808
Use async and make sure errors are passed to callback
2014-09-10 23:40:51 -07:00
Raymond Feng
59edab6b12
Make sure the deferred query will be invoked only once
...
See https://groups.google.com/forum/#!topic/loopbackjs/Ez1cyQ0D0s0
2014-08-25 13:19:47 -07:00
Raymond Feng
1bad43a4aa
Add ping()
2014-08-20 16:12:46 -07:00
Raymond Feng
ea51841f5e
Fix MySQL conversion for embedded model instance
2014-08-20 14:25:53 -07:00
Raymond Feng
7344088cc6
Fix the createDatabase option
2014-08-19 16:36:33 -07:00
Raymond Feng
8f62b08e70
Allow properties to pass through mysql driver
...
See https://github.com/strongloop/loopback-connector-mysql/issues/46
2014-08-15 16:27:12 -07:00
Raymond Feng
abaabff01a
Fix the default length for strings to avoid row size overflow
2014-07-08 11:23:45 -07:00
Johnny Bill
e52ae4b262
cannot read property of undefined fixed
...
fields seems to be undefined sometimes.
2014-06-16 12:32:29 +02:00
Raymond Feng
99b2950dab
Fix comparison for null and boolean values
2014-06-10 16:06:16 -07:00
Raymond Feng
5542839c3e
Map object/json to TEXT
...
See https://github.com/strongloop/loopback-connector-mysql/issues/36
2014-06-06 09:38:36 -07:00
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
99f9151d4f
Merge pull request #21 from strongloop/feature/fix-string-id
...
Fix the table generation for string ids
2014-04-08 10:48:20 -07:00
Raymond Feng
3165cb8bcd
Remove the commented out code
2014-04-08 10:47:00 -07:00
Raymond Feng
b0f636a4c4
Fix the query for discovery with current user
...
See https://github.com/strongloop/loopback-connector-mysql/issues/22
2014-04-08 08:35:39 -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
1e73a4b496
Fix merge issue
2014-02-13 08:35:52 -08:00
Raymond Feng
e54aa56cee
Reformat code
2014-02-12 16:57:06 -08:00
Samer Aldefai
3a06e0eae1
Update discovery.js
...
The issue is with the Discovery of Models. MYSQL Fields of Type 'POINT' are being discovered but loopback LDL model field provided by discovery functions is being of type 'String'.
missing code: case 'POINT': return 'GeoPoint';
for further information:
https://github.com/strongloop/loopback-connector-mysql/issues/17
2014-02-07 18:12:07 +01: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
20b9147970
Remove synchronous versions of the discovery APIs
...
Node.js mysql driver doesn't support sync query
2013-10-28 13:11:22 -07:00
Raymond Feng
839d7b4563
Fix the table_schema name
2013-10-22 11:45:31 -07: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
721e680bc3
Remove console.log
2013-10-08 14:03:19 -07:00
Raymond Feng
84b38b75cc
Allow custom engine and column types
2013-10-08 13:44:58 -07:00
Raymond Feng
869348df09
Fix discovery of exported keys
2013-10-08 13:44:37 -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