Git Product home page Git Product logo

adl's People

Contributors

simon-brooke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

adl's Issues

Aliased tables are not correctly referenced in convenience views.

We're seeing this:

------------------------------------------------------------------------
--	convenience view lv_animal of entity animal for lists, et cetera 
------------------------------------------------------------------------
CREATE VIEW lv_animal AS
SELECT holding.holding_identifier ||', '|| holding.name AS holding_expanded,
	animal.holding,
	animal.animal_identifier ||', '|| animal.name AS dam_expanded,
	animal.dam,
	animal.animal_identifier ||', '|| animal.name AS sire_expanded,
	animal.sire,
	animal.born,
	animal.animal_identifier,
	animal.name,
	gender.gender AS gender_expanded,
	animal.gender,
	species.species AS species_expanded,
	animal.species,
	breed.breed AS breed_expanded,
	animal.breed,
	animal.is_pedigree,
	pasture.name ||', '|| pasture.area AS pasture_expanded,
	animal.pasture,
	animal.id
FROM species, pasture, breed, gender, animal, holding
WHERE animal.holding = holding.id
	AND animal.dam = animal.id
	AND animal.sire = animal.id
	AND animal.gender = gender.gender
	AND animal.species = species.species
	AND animal.breed = breed.breed
	AND animal.pasture = pasture.id
;

Clearly, animal.animal_identifier ||', '|| animal.name AS dam_expanded should be dam.animal_identifier ||', '|| dam.name AS dam_expanded

Separate POST and GET handlers for forms/lists

For forms, GET is used to open a form, either new or populated from an existing record. POST is used to submit a form. If we provide separate handlers, it makes the flow easier.

With lists, again, GET is used to just fetch the list, POST is used to search it.

If we genetate separate GET and POST handlers for everything, then in the case of pages, the POST handler can just call the GET handler, because there isn't really any point in POSTing to a page (unless the page is what you get after POSTing a form?

Unnecessary 'requires' in generated cache

When generating cache.clj files, we generate a require list. Most of these requires appear to be unnecessary. The following commenting makes no difference to build in YouYesYet:

(ns
 youyesyet.cache
 "Caching wrappers for queries for youyesyet auto-generated by [Application Description Language framework](https://github.com/simon-brooke/adl) at 20220617T112222.113Z"
 (:require
  ;; [adl-support.core :refer :all]
  ;; [adl-support.rest-support :refer :all]
  [clojure.core.memoize :as memo]
  ;; [clojure.java.io :as io]
  ;; [clojure.tools.logging :as log]
  ;; [compojure.core :refer [defroutes GET POST]]
  ;; [hugsql.core :as hugsql]
  ;; [noir.response :as nresponse]
  ;; [noir.util.route :as route]
  ;; [ring.util.http-response :as response]
  [youyesyet.db.core :as db]))

I think (but need to check) that none of these requires are ever actually used. In which case they should not be generated.

re-frame

Generate a re-frame skeleton.

Luminus template

It would be very nice to be able to type

lein new luminus froboz +adl

and have a new Luminus project initialised with a skeleton ADL file, and all the glue needed to make it work, already in place.

Reimplementation of caching

Memoisation of handlers probably doesn't make sense, because every request
will be different. I don't think we can memoise HugSQL, at least not without
hacking the library (might be worth doing that and contributing a patch).
So the solution may be to generate an intervening namespace 'cache', which has one
memoised function for each hugsql query.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.