If you use Dynamic Columns in Maria 10.0+ and the Sequel Pro MySQL management tool then you may find this useful.
Dynamic Columns in MariaDB is like having a NoSQL document attached to every row of a MySQL table. It can solve the kind of problem that might otherwise lead you into committing a crime like EAV.
- Download Maria Dynamic Column.spBundle
- Save it in
~/Library/Application Support/Sequel Pro/Bundles/
(In the Finder: ⌘G and enter~/Library
Navigate from there.)
Select a row in a table that has a dynamic column blob and run the bundle:
- "Bundles" menu → "Data Table" → "Maria Dynamic Column"
- or shortcut key ⌃\ (control-backslash), which you can change by hacking in the bundle editor.
That's all.
It's really very simple if you are used to PHP and MySQL.
Open the bundle editor in Sequel Pro (⌘⎇⌃B), create a bundle and
copy-paste src/Maria Dynamic Column.php
. Set the
bundle options as show. Now hack!
To edit and save the object back in the DB, fork the repo, why not, and add something like this perhaps to edit and maybe something like that to save. (PRs welcome ;-)
The bundle requires PHP 5.4+. Apple provides PHP with OS X but yours may be 5.3 or older. You can install a newer PHP with homebrew. It's easy to port this bundle to 5.3 but I haven't done it yet. (PRs welcome ;-)
If you use the Yii 2 Framework and Maria Dynamic Columns then try yii2-dynamic-ar.
If you use PHP and not Yii, you should at least try out its Active Record ORM. It's really good.
Otherwise, consider extending your favorite ORM for Maria Dynamic Columns to spread the love of this fine technology.
Copyright (c) 2015, Tom Worster [email protected]
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.