Make the provider extensible
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 18/100
- Tipo de issue
- Funcionalidade
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Estagnada
- Stack de tecnologia
- fsharp, sql
- Domínio
- backend-api-design, databases
Direção de pesquisa
Comece lendo SqlDesignTime.fs por volta das linhas 52 e 354 e, em seguida, compare o commit vinculado e o exemplo de transactional-update com a API atual do provider. A issue precisa de um design de extensibilidade acordado antes da implementação; ela estará concluída quando houver uma API de extensão especificada e documentada que suporte os cenários propostos de entidades e transações sem quebrar a API atual.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
I was trying to create multiple entities that have foreign key dependencies between them in a single transaction, which is not currently possible. While trying to address the problem I realized that the provider could be of much more value if it allowed the programmer to extend it. In other words if a programmer could use the types extracted from the database to add more features to the provider such as transnational creation of entities. To test my hypothesis, I modified the provider to allow extensions: https://github.com/netogallo/SQLProvider/commit/0204f4db8c8e9210b8e0df728eb0b6571c55e77f with that in place I created an example of how it can be extended to have transactional updates: https://gist.github.com/netogallo/6c85782c89544a48552c . Both of theese examples are very raw and would need improvement if they were going to be part of the provider. I just created them to explain my ideas.
Now concretely speaking, how do I want to extend the provider:
-
The create methods of entities can accept entities as arguments where we currently accept foreign keys (SqlDesignTime.fs:354). My extension allows that but I have to change the type so it is the specific entity referenced by the relation (not any SqlEntity) but that would require more time and didn't wanna complicate it too much for a simple proposal. The referenced entities are stored differently in order to allow the entity to see the updates that happen in the referenced entity. This is what allows the transactional create to be possible since I can create the entities in the right order.
-
Define a super-class for the "serviceType" (SqlDesignTime.fs:52). I made SqlContext the super class in the example but I think it sould be a special class designed to provide a nice API to access the information of the provider in a useful and safe way for easier extensibility.Maybe create sub-classes for all the SQL drivers so one could extend the provider with MSSQL specific extensions w/o having to extend every provider.
-
The super-class for the "serviceType" should provide good methods to extend it's functionality. For example, the functions that are used to create insert/delete/update comands could be exposed and maybe also expose a method that takes a function (that takes a connection as an argument as an argument) and executes it inside an SqlTransaction? That way one can easily add more functionality to the type providers w/o much trouble. (With my example it is still tedious to do this, but you can).
Allowing the provider to be extended also allows it to be more modular. Ie. the basic provider infrastructure could be provided in one package and then database specific packages with the advanced functionality could be created separately so new features can be added to specific drivers w/o having to update drivers for all databases.
I volunteer to implement these changes properly, but I need advice and opinons about the proposal to know what would be the best way to make the provider extensible. On my sample, I focused on adding extensible w/o breaking the current API. Look forward for feedback.
- Linguagem predominante
- F#
- Estrelas
- 627
- Forks
- 147
- Merge médio
- 2h 2min
- PRs com merge (30d)
- 1
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de fsprojects/SQLProvider
-
enhancement
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
fsprojects/SQLProvider#872 · 2 comentários ·
-
Repo Assist? Abertaenhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 10/100
fsprojects/SQLProvider#870 · 1 comentário ·
-
postgresql
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 58/100
fsprojects/SQLProvider#869 · 2 comentários ·
-
documentation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 42/100
fsprojects/SQLProvider#868 · 2 comentários ·
-
sql server
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
fsprojects/SQLProvider#851 · 1 comentário ·
Todas as issues de fsprojects/SQLProvider
Issues semelhantes
-
Replayed reasoning items send "content": null, which the Responses API schema does not permit Abertabug CLI custom-model
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
bug confirmed issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
open-webui/open-webui#30750 · 1 comentário ·
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
danielmiessler/LifeOS#2234 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100