Make the provider extensible
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 18/100
- Issue-Typ
- Feature
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- fsharp, sql
- Bereich
- backend-api-design, databases
Rechercherichtung
Beginne damit, SqlDesignTime.fs um die Zeilen 52 und 354 zu lesen, und vergleiche dann den verlinkten Commit sowie das transactional-update-Beispiel mit der aktuellen Provider-API. Für dieses Issue muss vor der Implementierung ein abgestimmtes Erweiterbarkeitsdesign festgelegt werden; als abgeschlossen gilt es, wenn eine spezifizierte, dokumentierte Erweiterungs-API vorhanden ist, die die vorgeschlagenen Entitäts- und Transaktionsszenarien unterstützt, ohne die aktuelle API zu beeinträchtigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- F#
- Sterne
- 627
- Forks
- 147
- Ø Merge
- 2 Std. 2 Min.
- Gemergte PRs (30 T.)
- 1
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus fsprojects/SQLProvider
-
enhancement
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
fsprojects/SQLProvider#872 · 2 Kommentare ·
-
Repo Assist? Offenenhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 10/100
fsprojects/SQLProvider#870 · 1 Kommentar ·
-
postgresql
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 58/100
fsprojects/SQLProvider#869 · 2 Kommentare ·
-
documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 42/100
fsprojects/SQLProvider#868 · 2 Kommentare ·
-
sql server
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
fsprojects/SQLProvider#851 · 1 Kommentar ·
Alle Issues in fsprojects/SQLProvider
Ähnliche Issues
-
bug CLI custom-model
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
bug confirmed issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
open-webui/open-webui#30750 · 1 Kommentar ·
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
danielmiessler/LifeOS#2234 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100