Comments (6)
Hi @nigel-dewar, almost missed this as you opened and closed. I am open to PRs to Beef for sure (where they obviously make sense and move the capabilities forward).
For the code-gen config - to be honest not really considered anything beyond the XML, and more recently JSON/YAML. These provide a technology agnostic means to describe, there are many tools than enable editing, and then are easily consumed for code-generation. They also have a benefit of being somewhat terse and relatively easy for us to consume as humans. I'd be curious as to what it would look like as fluent. Before coding it up proper I would want to see how it would look to ensure it is viable and feels natural. Then I think it would be relatively simple to code-gen it up similar to what I have now for the XML/JSON schemas - this would mean there is one means to define internally, and multiple generated means to consume externally.
PostGres is something I am very keen on. In some ways it would be relatively easily supported by using the built in EF runtime support. However, there is a lot more work involved in getting Beef.Database.Core
equivalency. The DbUp functionality would be relatively straight forward as it already supports, but the stored procedure gen, etc. would require the most effort. Is this what you are proposing?
More than happy to chat more. Cheers...
from beef.
Hi @chullybun , Yes sorry I opened and closed as I saw the discussions area and thought I would pop this question in there later. ( And you found this close issue sooner than I expected, hahah ).
I totally understand the reasoning now on the YAML, XML templates, true that, it does make it technology agnostic and that helps me understand where you are taking this framework. What I can perhaps do is build a small sample of what I had in mind as towards a "Fluent" api. My take on it would be that the fluent api library would be a "plugin" as much as say https://github.com/StackExchange/Dapper/tree/main/Dapper.Contrib "Dapper Contrib" is for Dapper. This would allow a developer to "add-on" the fluent functionalities "only" if the want to.
You might call this plugin the "Beef Sauce" or something like that or Beef Contrib. You don't need it. You can do just fine without it, but if you want some sugar on top when comes to configuring the code gen for the the entities and database gen, then you might use this plugin. The Fluent API plugin would need to be versioned accordingly against each version of beef.
As said, I think its a good idea if I provide a sample POC and you can eval if it works and makes sense. It may be a completely dumb idea, but a POC will show it up if so. It may be just the case that since I'm a noob to beef the concept of defining everything in YAML or XML is just foreign to me, and that I miss the overall intent. YAML and XML is straight forwards, and ya know as they say, "key to sophistication is simplicity". Folks often end up over-complicating things, perhaps what I propose is just that, but I'm just curious to see if a fluent API might work.
With PostGres, yes indeed the Stored Proc gen is specifically what I had in mind, and yes it would require much effort which is specifically where I would like to contribute.
cheers
from beef.
Hi @nigel-dewar. Beef Sauce - hahaha, like it. I still think this in and of itself is a candidate for code-gen similar to what is there for the XML schema. This way we would largely avoid versioning issue. There would need to be some other changes to code-gen as it is dependent on the config files existing to function; so this fluent capability could update these files and the rest would function largely as-is. Hmm. Again, would be good to see the proposed fluent to see if it is better than the XML/JSON/YAML. Are we fixing something that is not broken? What is the potential benefit?
As stated, PostGres sounds really appealing. The stored procedure gen will be fun, but will take time to develop out all the equivalent handlebars templates.
Cheers...
from beef.
G'day @chullybun , ya know the more I use the XML config the more I see what you mean. It works really well, and although initially it may seem rather foreign, it makes sense. And yeah, it prob is just trying to fix stuff that aint broken too.
Since the Postgres is an addition that will extend the frameworks capabilities I will just focus on that. Truth be told its the functionality that I also want most too.
I started looking through the code again tonight, and I'll likely spend several nights debugging around to get a rudimentary understanding of what is happening. If you have any tips and tricks, and insights to shorten my journey that'd be great if you could please share.
At this stage, I'm starting from the Sample CodeGen and working down from there. If this is the wrong place to start, please let me know.
And I did notice the awesome suite of tests as well, so Ill be spending alot of time studying these.
Cheers
from beef.
Hi @nigel-dewar,
In terms of codegen for postgres - the best place to look is at the existing templates. To understand how the codegen works look at this. For it to work against a database it also needs to interpret the database, which it does by querying the database - see here - this in theory should work against a postgres db as it uses the INFORMATION_SCHEMA
schema. Trying running this for postgres.
The steps to codegen for me start with creating an example of what good looks like before turning into a template.
Cheers...
from beef.
Thank you mate, Ill start in these places as advised. cheers
from beef.
Related Issues (20)
- DataMapping IndexOutOfRangeException exception for incorrect filed names. HOT 1
- Cant add people from middle ages to Beef.Demo
- Sql Text/NText columns cant be used in the Cdc Code Generator as they arent mapped to a .NET type HOT 1
- In the Demo project, RegenerateAll.ps1 changes working directory HOT 1
- Feature idea - redirect from / to swagger
- Feature idea - docker-compose/tye file for running Mr.Hr sample with SQL database
- Feature Request - Asynchronous Call Integrity HOT 2
- Namespaces conflict has occured when creating "User" entity with Cosmos DB HOT 1
- Cosmos DB "PartitionKey has fewer components than defined the collection resource." error in Azure App Service HOT 1
- AgentTester RegisterBeforeRequest ineffective withhin test class.
- .ExpectChangeLogCreated( ) fails when API takes a little longer to return value. HOT 3
- membersToIgnore parameter of ExpectEvent<T>( ) doesn't work HOT 3
- OmitEntityBase breaks entities when used with a custom PathCommon HOT 1
- Merging reference data does not work when using multibyte-charractors HOT 1
- idea: Add conditional branching based on the existence of an ExtraProperty item and an item value to the template in Demo sample.
- Project naming could create confusion with existing "BeEF" public project HOT 1
- Test fails: 'The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached' HOT 3
- OpenAPI (Swagger) contains unnecessary models HOT 1
- PagingArgs parameter does not recognized by OpenAPI (Swagger) HOT 3
- Security Policy violation Outside Collaborators HOT 46
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from beef.