

Looking at the documentation of those two functions you'll notice that the second argument is always the columns to be used for the index (the example on drop: drop index ('posts', :name. If not enough information to reproduce the issue, you can ask saying, “I want to try and reproduce this, what information do I need?” That’s going to help the maintainer who hasn’t yet asked the question to get more information from the user. When you do drop index ('foo', :barpendingindex) you're invoking the same index/3 function used to create an index, similar to uniqueindex/3.If the ticket has enough information to reproduce, you can say, “Yes I’m still seeing this” or “No, I’m not seeing this.” Either is helpful to the maintainer. Go through the list of issues and try to reproduce it.Its domain-specific language provides a pleasant way to interact with databases and build fault-tolerant, concurrent applications in Elixir with ease. Mike’s tips on contributing to an open source project: Ecto is a database wrapper that lives up to the high expectations set by Elixir’s reputation.– Ecto changelog showing 3.5 release changes.



That's it! Make sure your log level is set appropriately, restart your app, and you should see all Ecto queries logged in this new format instead of the old one.Learning about some new features coming in Ecto 3.5 from Mike Binns. In config/config.exs, configure MyApp.Repo to disable the standard Ecto logging: config :my_app, MyApp.Repo, Params = inspect(entry.params, charlists: false) # Strip out unnecessary quotes from the query for readability Time_us = nvert_time_unit(entry.query_time, :native, :microsecond) In lib/my_app/repo.ex, define the log_query function: (note: in my case I've hard-coded the :debug log level.). That function can live wherever, but in my case I've put it in _query/2: config :my_app, MyApp.Repo, Its perfect in our case, since its natural to create a new link when creating a new bookmark. While buildassoc creates a new association on a record, putassoc creates or replaces an association on a changeset. In config.exs, configure MyApp.Repo to use a new custom logger function. It takes a changeset, an association name and attributes. But this works very differently in Ecto v2 versus Ecto v3. It looks like there's no such thing as customizing Ecto's logging format instead I needed to disable the built-in logging and write my own logging function. How can I customize the format of the Ecto sql query logs? Ideally I'd like to strip out the quotes around the field names so the query is easier to visually scan.It's important to me to have all this info on a single line, because that makes it much easier to find events in log management services like Papertrail. Each sql query produces two lines of log output.SELECT p0."id", p0."project_id", p0."admin_id", p0."inserted_at", p0."updated_at", p0."project_id" FROM "project_admin_joins" AS p0 WHERE (p0."project_id" = $1) ORDER BY p0."project_id" īut I'd love to tweak a couple things about this format: QUERY OK source="project_admin_joins" db=1.9ms In my Phoenix/Ecto apps, when I set log level to :debug, I see helpful log entries for each SQL query issued by Ecto, like this: QUERY OK source="users" db=1.9ms
