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

fix: cast/uncast STRING and TEXT with non-string type value, and some type definitions #368

Merged
merged 2 commits into from
Nov 9, 2022

Conversation

JimmyDaddy
Copy link
Collaborator

att

@@ -66,6 +66,16 @@ class STRING extends DataType {
return chunks.join(' ');
}

cast(value: any): any {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class Note extends Bone {
  static attributes = {
    meta: TEXT,
  }
}

// fixed:
// logger output: INSERT `notes` (`meta`) VALUES (`name`='bloodborne', `type`='Cthulhu');
// actual SQL: INSERT `notes` (`meta`) VALUES ('[object object]');
const meta = { name: 'bloodborne', type: 'Cthulhu' };
const note = await Note.create({ meta });

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@cyjake cyjake merged commit 112ab32 into master Nov 9, 2022
@cyjake cyjake deleted the fix/insert_json_type_check_strictly branch November 9, 2022 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants