#19 As a developer I want to re-factor `createdb` to make it more modular

Ouvert
Créé il y a 1 mois par george · 0 commentaires

Right now (createdb) includes some checks for sqlite3 library availability, database creation, and some output messages to the user. Future changes to the database schema (such as what is needed for #16) need to be added, but we need to separate the creation of the database (with the latest schema) from updating a database to a newer schema.

Consider addressing this by moving the database creation/update routines into a new file that can be (require)'ed by proposal_database.rkt. This new file/module would have:

  • A function to create the proposals table, using the same schema as is presently in the code.
  • One or more functions that provide individual schema updates
  • an (updatedb) function that assesses the schema of the database, determines which updates are needed, and applies them
Right now `(createdb)` includes some checks for sqlite3 library availability, database creation, and some output messages to the user. Future changes to the database schema (such as what is needed for #16) need to be added, but we need to separate the creation of the database (with the latest schema) from updating a database to a newer schema. Consider addressing this by moving the database creation/update routines into a new file that can be `(require)`'ed by `proposal_database.rkt`. This new file/module would have: - A function to create the `proposals` table, using the same schema as is presently in the code. - One or more functions that provide individual schema updates - an `(updatedb)` function that assesses the schema of the database, determines which updates are needed, and applies them
Connectez-vous pour rejoindre cette conversation.
Aucun jalon
Pas d'assignataire
1 Participants
Chargement…
Annuler
Enregistrer
Il n'existe pas encore de contenu.