keenmate / db-gen Goto Github PK
View Code? Open in Web Editor NEWLanguage agnostic database function calls code generator for Enterprise use
Language agnostic database function calls code generator for Enterprise use
Running dbgen init
creates a configuration and/or templates in current folder.
init
command should be probably interactive and ask user for values it needsdbgen.json
will contain values based on user input or default values stored in the db-gen packageImprove logging to show what procedures were changed, added, deleted
db-gen
should save all loaded procedures to some intermediate file. This would allow users to regenerate files without having access to database. This also opens up new opportunity for future use cases (eg. verifying that database has all required procedures).
This is not a breaking change and should just be opt-in.
New command will be added, that will just create file with all procedures
New parameter would be added to generate
command, that will skip process of loading procedures from database and user provided file instead
So not only .local.
will be possible to use but also .[env].
files as well.
This will be used in CD/CI pipelines or to generate files using test/production templates.
User should be able to override information about function that is returned from database.
This will be only used in some edge cases, so it should not create burden on rest of usecases.
User should be able to change:
User shouldnt have to specify every mapping, only those that he wants to override
Propoposed configuration:
// ...
"Generate": [
{
"Schema": "public",
"AllFunctions": true,
"Functions": {
// maybe not best idea to store values in keys (probably ok)
"database_function_to_be_ignore": false,
// in case of function overloading, you have to explicitly specify mapping
"function_with_custom_mappings(int,int,text)":{
// name of function in generated code
// by default model is named customNameModel and processor customNameProcessor
"MappedName": "customName",
// client can use execute instead of select to save bytes
"DontSelectValue": true,
"SelectAllColumns": true,
"Model":{
// explicitly remove
"column1": false,
"column2":{
// not required
"MappedName": "better_name_for_col2",
"MappedType": "int",
// if mapping function is not set use one defined in global mappings
"MappingFunction":"mapToInt",
// this infomation is not used by db-gen, but can be used in templates
"IsNullable": false
}
},
// it doesnt really make sence to send only some parameters, so you are only able to override name and dataType?
"Parameters":{
"function_parameter": {
"IsNullable": true,
"MappedName": "better_name",
"MappedType": "int"
}
}
}
}
},
{
"Schema": "test",
"AllFunctions": false,
"Functions": {
"explicitly_included": true,
"another_included_func": true
}
}
],
// ...
It is usefull to store information about what version of db-gen was used for generation.
User should be able to override information about function that is returned from database.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.