Created
January 2, 2018 21:39
-
-
Save weixiyen/62e498fb6e2942daa6325be8449290f8 to your computer and use it in GitHub Desktop.
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 characters
defmodule Schema.UserByEmail do | |
require Schema.User # if you want to auto-create at compile time | |
use Triton.MaterializedView | |
materialized_view :users_by_email, from: Schema.User do | |
fields [ | |
:user_id, | |
:email, | |
:display_name, | |
:password | |
] | |
partition_key [:email] | |
cluster_columns [:user_id] | |
with_options [ | |
gc_grace_seconds: 172_800, | |
clustering_order_by: [ | |
email: :asc, | |
user_id: :desc | |
] | |
] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment