MarkMpn / Sql4Cds

SQL 4 CDS core engine and XrmToolbox tool
MIT License
72 stars 20 forks source link

CrmAdo #255

Closed dazinator closed 1 year ago

dazinator commented 1 year ago

Hi!

Just in case you were interested I wanted to share a similar project I worked on several years ago, to create an Ado.net provider for Xrm

I managed to complete a feature rich library, which didn't only support DML but also DDL - a quick intro of features is here: http://dazinator.github.io/CrmAdo/

I also ceated a DDEX provider for VS (possibly 2017 at the time) so you could connect via server explore and query directly in VS: https://marketplace.visualstudio.com/items?itemName=DarrellTunnell.CrmAdoDDEXProvider

Having moved out of the dynamics world this projects have sat in a doomed state for a while now though.

MarkMpn commented 1 year ago

Nice, I hadn't come across this project before.

I'd considered adding DDL support but I got stuck on figuring out how to express the complexities of things like whether a string field should be presented as a regular text field, email, phone, url etc and all the other rich types like optionsets, along with how any new tables/columns should be linked to solutions. Did you figure out a way to handle any of that?

dazinator commented 1 year ago

Yeah for the most part. You can see the various cases I supported https://github.com/dazinator/CrmAdo/blob/master/src/CrmAdo.Tests/Tests/AlterTableTests/AlterTableStatementTests.cs (there are similar tests for CREATE).

In terms of linking entities with solutions etc, I don't think I've tried that using CrmAdo. I do remember creating a publisher record as a requirement for something using CrmAdo to insert the publisher.. it has been a long time.. I beleive the org might have a "default publisher" concept and therefore any entities you create via DDL might be associated with the default publisher somehow and not really part of any solution but still functional. I certainly remember discovering that publisher and solutions were also just entities and could therefore be manipulated as such so I dont think there is a technical limitations preventing solutions from being created entirely through something like your library or CrmAdo however I suspect the solution file to contain payloads and other metadata that might not be friendly to work with, so the best way to produce the solution may be to use some other tool maybe with a GUI. At that time I personally viewed the packaging up of entities / plugins etc into a solution as part of a seperate use case for essentially solution publishers - i.e a dynamics developer would do this, and I created http://dazinator.github.io/CrmUp/ to do continuous deployments to crm systems of the solution files (as well as data for the environment) which was run as part of a ci/cd pipeline.