Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mysql2 lib to be able to use MySQL 8 #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

atog
Copy link

@atog atog commented Sep 28, 2023

No description provided.

@fengzai6
Copy link

fengzai6 commented Sep 2, 2024

I need it too

@fengzai6
Copy link

sometime use find function will throw error:AdapterError: Unexpected error from database adapter: "[object Object]" is not valid JSON

@Harm-Nullix
Copy link

Why is this not merged by 2024?
https://endoflife.date/mysql

@Harm-Nullix
Copy link

Harm-Nullix commented Oct 21, 2024

@mikermcneil ,
@eashaw , any light on this?

@MarijnMensinga
Copy link

MarijnMensinga commented Oct 22, 2024

@fengzai6 and @Harm-Nullix I found the issue. If a model property has type json and the database fieldType is also json mysql2 returns the data as parsed (json) object instead of the json string. Therefore a small change is needed in sails-mysql as well. Since this ticket/library seems dormant I've created a fork with the fixed in it. If you want you could add
"sails-mysql": "https://gitlab.com/newtee-public/balderdashy-sails-mysql.git" to your package.json and you'll be able to use mysql 8 with your sails backend. It also packs the fixed dependency from this PR: https://gitlab.com/newtee-public/sailshq-machinepack-mysql2

@fengzai6
Copy link

@fengzai6 and @Harm-Nullix I found the issue. If a model property has type json and the database fieldType is also json mysql2 returns the data as parsed (json) object instead of the json string. Therefore a small change is needed in sails-mysql as well. Since this ticket/library seems dormant I've created a fork with the fixed in it. If you want you could add "sails-mysql": "https://gitlab.com/newtee-public/balderdashy-sails-mysql.git" to your package.json and you'll be able to use mysql 8 with your sails backend. It also packs the fixed dependency from this PR: https://gitlab.com/newtee-public/sailshq-machinepack-mysql2

OK,I will try it, thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants