Created
September 21, 2020 23:19
-
-
Save Ch4s3/8100fa09ab947e1def24685130a3aa5c to your computer and use it in GitHub Desktop.
Revisions
-
Ch4s3 created this gist
Sep 21, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ from(c in City, select: c) # returns the schema as a struct from(c in City, select: {c.name, c.population}) # returns Tuple of {name, population} from(c in City, select: [c.name, c.county]) # returns List of [name, county] from(c in City, select: %{n: c.name, answer: 42}) # returns Map with keys :n, and :answer from(c in City, select: %{c | alternative_name: c.name}) # returns the schema as a Struct with :alternative_name added from(c in City, select: %Data{name: c.name}) # returns the selected name in %Data{}