-
Notifications
You must be signed in to change notification settings - Fork 11
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
Support for complex fields #24
Comments
Yes, json is currently not parsed. Need to implement it. |
@mpapis, just to be sure to work on your dataset, can you provide me a sample dump? |
In the example:
CREATE TABLE `points` (
`id` bigint NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`contacts` json DEFAULT NULL,
`owner` json DEFAULT NULL,
`emails` text,
`created_at` datetime(6) NOT NULL,
`updated_at` datetime(6) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
INSERT INTO `points` VALUES (1,'Shop1','[\"person1@shop1.com\", \"person2@shop1.com\", \"person3@shop1.com\"]','{\"email\": \"owner@shop1.com\", \"last_name\": \"Sawyer\", \"first_name\": \"Tom\"}','person1@shop1.com,person2@shop1.com,person3@shop1.com,owner@shop1.com','2024-04-09 17:58:27.502417','2024-04-09 17:58:27.502417'),(2,'Shop2','[\"person1@shop2.com\", \"person2@shop2.com\", \"person3@shop2.com\"]','{\"email\": \"owner@shop2.com\", \"last_name\": \"Smith\", \"first_name\": \"Will\"}','person1@shop2.com,person2@shop2.com,person3@shop2.com,owner@shop2.com','2024-04-09 17:58:58.337830','2024-04-09 17:58:58.337830'); I've stripped down the dump from things I did not thought were important, let me know if you need the whole thing. |
Update: just found out that |
Update2: also found another use cases with such fields: '{\"emails_changes\":[[\"contact1@shop1.com\"],[\"contact1@shop1.com\",\"contact2@shop2.com\"]]}',
'{\"emails\":[\"contact1@shop1.com\",\"contact2@shop2.com\"]}',
'{\"email_changes\":[\"contact1@shop1.com\",\"contact2@shop2.com\"]}', |
Hi!
Just to be sure, do you mean a given field in a table may have different json structures depending on rows ? Or are you talking about different fields? I started to work on json support, and for the moment, I expect to have the same json structure for a given field. Let me know! |
unfortunately, the structure will be different, we are using one table to keep versions (history) of all other tables, and we store field
As mentioned earlier the value can be also an array, so for object_changes this would be possible that multiple parts of the json needs to be handled, including nested arrays support. |
Thanks for you reply, I think it will be easier for me. Just in case, I submitted my current (non complete) work for static json structure on branch issue24. |
Hi @mpapis, Partial work for the moment, code in branch issue24_2 should now cover one of your needs (points.owner). You can have a look at tests/complex.sql and tests/complex.conf I will now work on your other needs, but in the meanwhile, feedback is welcome. Thanks! |
I had a look at the changes, looks good so far 😄 |
Hi @mpapis, still in the same branch, I added support for fiels separated by a given char. Test case (tests/complex.sql - tests/complex.conf) has been updated. |
I have field data in JSON Arrays and simple coma separated list in string, right now whole field is anonymized which "destroys" the array format of it.
The text was updated successfully, but these errors were encountered: