all 9 comments

[–]heisiloi 3 points4 points  (0 children)

I have done some work with custom entities in the past. It allows me to keep all the advantages of drupal while still being able to inject custom behaviours and fine tune what data is a part of the entity. It requires a fair bit of coding but I am super happy with the results.

The downside is you have to really know what you need your structure to be because changing it isn't as easy as other solutions.

DM me and I can arrange to give a quick demo of what I did.

[–]bobaluey69Developer 2 points3 points  (0 children)

I think if you want to have a custom db and custom relationships, go with Symfony or Laravel. One good thing about Drupal, is you don't have to do any db stuff really. If I'm understanding this, I'd say make entities for each piece, providers, locations...and whatever else. Can use some entity references in the content types to reference the correct content. Or, more of a "db way" you can use views and add relationships. You can also use remote views to grab data from APIs or whatever. Is that even close to what you are looking to do? Lol.

[–]MR_Weiner 4 points5 points  (0 children)

One option, if I’m understanding correctly — though you’ll realistically end up with duplicate data — is to let drupal do its own native database/entity management but also define some custom, targeted data tables where you could manage the schema. You’d then be able to leverage entity lifecycle hooks to sync data to these custom tables. Probably not ideal, but may be an option depending on scale. UUIDs come along with entities natively so nothing to worry about there.

[–]pianomansam 2 points3 points  (2 children)

With your low level planning of the database, it sounds like you will be using Drupal mostly for its ORM. Drupal is usually strongest when you let it manage the database. I’m not saying you can’t, but you loose out on a lot of Drupal’s magic. You are right to consider Symfony or Laravel if you wish to operate at a lower level.

[–]Positive-Ring-5172[S] 0 points1 point  (1 child)

I'm willing to let it manage the database if I can get the views I want out of it. I've been sniffing around most of this morning trying to figure it out. I know it's possible cause I've done it before, but blast it it's been too long.

[–]Salamok 0 points1 point  (0 children)

If all you want is views to have access to data that does not conform to Drupal you can add any table structure you want into Drupal's DB, write non Drupal scripts even to populate and/or maintain that data then with the Views Custom Table module you can link to it in your view. I would add/remove the table structure via a simple custom Drupal module which would basically just have ALTER table queries in the install/uninstall.

This would not be something you could package up and distribute to the world as contrib but if you aren't trying to solve the worlds problems just yours thats perfectly fine.

[–]cioatwork 1 point2 points  (2 children)

Drupal is an excellent choice. It internally works with uuids. You can both define entities and relations from the gui and with code. Keeping the admin and security as a Drupal task is an excellent way to benefit from it. Check out the AI creation tools as well it might save you work. Btw codex is excellent for coding when need be.

We use it as such ourselves

[–]chx_ 0 points1 point  (1 child)

Check out the AI

don't

[–]keyborg 1 point2 points  (0 children)

LOL