8000 Code from Docs does not work · Issue #48 · cheerfulstoic/ecto_watch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Code from Docs does not work #48

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

Open
dv01sw opened this issue May 9, 2025 · 2 comments
Open

Code from Docs does not work #48

dv01sw opened this issue May 9, 2025 · 2 comments

Comments

@dv01sw
Copy link
dv01sw commented May 9, 2025

https://github.com/cheerfulstoic/ecto_watch/blob/main/guides/introduction/Watching%20without%20a%20schema.md#L1

  # setup
  {EctoWatch,
   repo: MyApp.Repo,
   pub_sub: MyApp.PubSub,
   watchers: [
    {
      %{
        table_name: "comments",
        primary_key: :ID,
        columns: [:title, :body, :author_id, :post_id],
        column_map: %{body: :bodyContent},
        association_columns: [:author_id, :post_id]
      }, :updated, extra_columns: [:post_id]
    }
   ]}

This throws a warning about a missing :label option. But when I add the :label, it complains that :label is not a valid option 😕

@dv01sw
Copy link
Author
dv01sw commented May 9, 2025

Could you update the Example to show how the label should be set?

@cheerfulstoic
Copy link
Owner

Yeah, absolutely the docs should be updated! Could you try it out first to make sure it's working for you in your case?

  {EctoWatch,
   repo: MyApp.Repo,
   pub_sub: MyApp.PubSub,
   watchers: [
    {
      %{
        table_name: "comments",
        primary_key: :ID,
        columns: [:title, :body, :author_id, :post_id],
        column_map: %{body: :bodyContent},
        association_columns: [:author_id, :post_id]
      }, :updated, extra_columns: [:post_id], label: :your_label_here
    }
   ]}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0