Commit Graph

134 Commits

Author SHA1 Message Date
Samarpan Bhattacharya 07173b6bde feat: add mysql8 support, update to mysql2 client and drop nodejs v14 and mysql5.7 support
BREAKING CHANGE
drop mysql5.7 support

Signed-off-by: Samarpan Bhattacharya <this.is.samy@gmail.com>
2023-06-30 15:28:47 +05:30
Samarpan Bhattacharya a3b354b7f4 feat: add support for multiple insert in one query
BREAKING CHANGE
drop nodejs v12 support and juggler v3 support

Signed-off-by: Samarpan Bhattacharya <this.is.samy@gmail.com>
2023-01-06 08:25:20 -08:00
Rifa Achrinza 21e3bba4c4 fix: remove redundant debug
closes https://github.com/loopbackio/loopback-connector-mysql/issues/352

Signed-off-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com>
2022-08-10 11:41:24 +00:00
Akshat Dubey bb6010ad01 feat(operators): add match against operator
Signed-off-by: Akshat  Dubey <akshat.dubey@sourcefuse.com>
2021-10-16 18:20:56 +05:30
Diana Lau 7697ed2b41 chore: move this repo to loopbackio org
Signed-off-by: Diana Lau <dhmlau@ca.ibm.com>
2021-07-12 11:57:16 -04:00
yongzhi-chen f82154145d fix (core) accepts boolean type
Signed-off-by: Mario Estrada <marioestradarosa@yahoo.com>
2021-05-26 12:52:44 -06:00
Miroslav Bajtoš 7ce66b5b81
update eslint + config to latest
Also fix linting errors, most notably get rid of `var` keyword.

Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
2020-08-28 08:43:09 +02:00
Diana Lau 2bb2f8d51f chore: update copyrights year 2020-02-08 17:23:33 -05:00
jannyHou 01c94b6a60 feat: run shared tests 2019-07-09 11:35:59 -04:00
Antonio Trapani bc220f5a64 fix: allow DataSource to reconnect properly
Fixes issue where calling disconnect() method
and then the connect() method causes the "Pool
is closed" error. See issue #367.
2019-05-23 14:08:26 -04:00
Agnes Lin a12558e8a4 chore: update copyrights years 2019-05-07 13:37:19 -04:00
biniam ad44168d4a isNewInstance undefined for after save hook
Since using REPLACE or INSERT...ON DUPLICATE KEY
statements both give us affected rows of 1 for a
new row or a row which got updated with the same
values, we make isNewInstance undefined on after
save hook for save, replaceOrCreate, and
updateOrCreate methods. Also, disable juggler
tests for that functionality.
2017-07-26 22:21:06 -04:00
biniam 7a7a34e77f upgrade eslint deps 2017-07-25 15:41:11 -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
ssh24 145d061e94 Allow case sensitive regex operation 2017-06-13 10:18:27 -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 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
biniam 0187f0434b Revert "switch long and lat for geopoint type"
This reverts commit dd5bfb3f82.
2017-05-31 10:30:00 -04:00
biniam dd5bfb3f82 switch long and lat for geopoint type 2017-05-30 09:29:36 -04:00
Joost de Bruijn c3a336c18d Adding support for fractional seconds. 2017-05-05 19:15:41 -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
Sakib Hasan 345492e5b2 Revert PR #257 (#266) 2017-04-24 16:19:33 -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
juanra a8e22c5bff fix linting problems 2017-03-21 10:45:24 +01: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 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
ulion f316b8ca7d Fix mysql neq for NULL value. 2015-03-08 22:57:36 +08:00
Raymond Feng 634a0a94bc Allow models backed by MySQL to reference mongodb ObjectID 2015-03-04 22:55:33 -08: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 7fe8306db2 Use mysql.escape/escapeId() 2015-01-09 09:02:36 -08:00