1. 21

One of the things I’ve found tedious while building web apps with Racket over the past 10 months has been mapping from structs to database tables so I made this library to solve that particular problem!

  1.  

  2. 3

    It seems that it only supports PostgreSQL and SQLite at the moment, but the tutorial does a good job on showing what can be done. This made me consider Racket for database purposes. I’d like to see how it compares to Common Lisp solutions such as Mito.

    1. 1

      if I understand the docs correctly, the racket struct is always the source of truth, and the db table is defined from it. I would love to see support for the other use case too, where you can use racket to quickly connect to an existing database and have structs autogenerated for the tables.

      1. 3

        the racket struct is always the source of truth, and the db table is defined from it.

        I will update the docs to clarify this; thank you for bringing it up. The table is meant to be the source of truth, with the schema able to represent either the whole table or just a part of it (to support use cases with really wide tables). Creating the table from the schema/struct is convenient for the tutorial but not really the intended use case (in fact, in real projects I use north for migrations and do not use deta’s DDL features at all).

        I would love to see support for the other use case too, where you can use racket to quickly connect to an existing database and have structs autogenerated for the tables.

        racquel does support this, but, unfortunately, is based around the class system and not on structs.

        1. 1

          i filed a bug against racquel which just sat there, which makes me think the project isn’t really active any more :(