-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tutorial for Append Only Database/Log #2
Conversation
@Danwhy I'm going to take a look at this tonight. Following along ... 👍 |
README.md
Outdated
|
||
``` elixir | ||
defmodule Append.AppendOnlyLog do | ||
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have alias Append.Repo
on this line. Sorry @nelsonic! I'll add it in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries. don't apologize. you've done a great job with this guide (so far!) 🎉
(thanks! hope you're feeling much better!)
Have to add: alias Append.Repo To the top of adding to code/instructions in |
|
||
def update(%__MODULE__{} = item, attrs) do | ||
item | ||
|> Map.put(:id, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unclear why we need to remove the :id
is it not auto-incremented by Postgres when the record is inserted?
…og-example into tutorial
Codecov Report
@@ Coverage Diff @@
## master #2 +/- ##
=========================================
Coverage ? 56.75%
=========================================
Files ? 11
Lines ? 37
Branches ? 0
=========================================
Hits ? 21
Misses ? 16
Partials ? 0
Continue to review full report at Codecov.
|
postcode: "NW SCA", | ||
}) | ||
|
||
history = Address.get_history(updated_item) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be an {:ok, history} = Address.get_history(updated_item)
tuple pattern match?
or does Repo.all(query)
always return a List
(even if it's empty) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Danwhy this is an excellent start.
I was able to follow along on my localhost
without any issues (other than those described/fixed above):
Happy to merge this so others can benefit from it.
And we can iterate on it further when we have time.
@Cleop do you prefer to try follow the steps in PR/branch form or can I merge to master
?
Thanks again! ❤️ ✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Cleop thanks. 👍 |
Note: we still need to add the answers to the "intro questions": #1 (comment) I'm going to add those to a separate PR shortly. |
Adds basic guide for creating a schema and a behaviour to facilitate an append only database, with code and tests.
There are still some improvements/advancements that could be made to the guide (see open questions in #1), but this should be a good starting point