!CnJOKhVeFQDJJFlIls:57north.org.uk

Elixir

770 Members
Unofficial room for chatter about the Elixir language. This room is publicly logged. For a room tunneled with the IRC channel, go to #elixir:libera.chat.87 Servers

Load older messages


SenderMessageTime
29 Mar 2024
@rktjmp:matrix.orgSoupwhat error does it give you?07:16:53
@b00tr:matrix.orgb00tr
Mix.install(
  [:ecto, :ecto_sql, :ecto3_mnesia, :kino, :kino_db]
)
defmodule MyApp.Repo do
  use Ecto.Repo, otp_app: :my_app, adapter: Ecto.Adapters.Mnesia
end
Kino.start_child({MyApp.Repo, []})
{:error,
 {%ArgumentError{message: "unknown application: :my_app"},
  [
    {Application, :app_dir, 1, [file: ~c"lib/application.ex", line: 1010]},
    {Application, :app_dir, 2, [file: ~c"lib/application.ex", line: 1037]},
    {Ecto.Adapters.Mnesia.Config, :set_path, 1,
     [file: ~c"lib/ecto/adapters/mnesia/config.ex", line: 39]},
    {Ecto.Adapters.Mnesia.Config, :new, 1, [file: ~c"lib/ecto/adapters/mnesia/config.ex", line: 10]},
    {Ecto.Adapters.Mnesia, :init, 1, [file: ~c"lib/ecto/adapters/mnesia.ex", line: 66]},
    {Ecto.Repo.Supervisor, :init, 1, [file: ~c"lib/ecto/repo/supervisor.ex", line: 185]},
    {:supervisor, :init, 1, [file: ~c"supervisor.erl", line: 330]},
    {:gen_server, :init_it, 2, [file: ~c"gen_server.erl", line: 962]}
  ]}}
14:18:32
@b00tr:matrix.orgb00trThe same code but for Postgres works fine14:18:53
@rktjmp:matrix.orgSoupYou should try asking on the elixir forum perhaps. Perhaps the postgres adapater is a bit less hooked into OTP compared to mnesia which might make sense, and so it agrees to run even if the otp app given isn't actually running. 16:12:58
@rktjmp:matrix.orgSoupNot sure how to start an application with a specific atom name, normally thats done in the mix.exs file16:13:21
@rktjmp:matrix.orgSoupnormally the "app name" is given in the mix.exs file * 16:13:35
@b00tr:matrix.orgb00trIt seems that a proper Mix project has to be created first with a DB schema and running mix ecto.create and only then the live book can be attached to this application and use the db :(( .. which requires a shell and cannot be done solely in livebook16:42:56
@b00tr:matrix.orgb00trecto sqlite seems to be the way to go.. it's running no problem.. mnesia is probably obsolete23:58:15
@b00tr:matrix.orgb00tr * ecto sqlite seems to be the way to go.. it's running no problem.. mnesia is probably obsolete and defunct23:58:35
30 Mar 2024
@b00tr:matrix.orgb00tr * ecto sqlite seems to be the way to go.. it's running no problem.. ecto mnesia support is probably obsolete and defunct15:53:48
@b00tr:matrix.orgb00trIs it possible to unset/destroy a module?15:55:36
@b00tr:matrix.orgb00tr * Is it possible to undefine/unset/destroy a module?15:55:53
@Nicd-:matrix.orgNicd
In reply to @b00tr:matrix.org
Is it possible to undefine/unset/destroy a module?
https://www.erlang.org/doc/man/code#delete-1 and purge/soft_purge do something like that
19:54:27
@b00tr:matrix.orgb00tr
In reply to @Nicd-:matrix.org
https://www.erlang.org/doc/man/code#delete-1 and purge/soft_purge do something like that
thank you!
22:00:56
@b00tr:matrix.orgb00trNow I can change NIFs at runtime in livebook without problems :)22:02:32
31 Mar 2024
@b00tr:matrix.orgb00trwow.. so I finally put together pure Elixir script that computes histograms for 56k files at 2GB in 15 seconds. no NIFs.. thats really cool04:09:11
@kshlm:matrix.orgkshlm changed their display name from kshlm to kshlm (Old).04:13:57
@rktjmp:matrix.orgSoupwhats your plan for 10s?04:14:27
@rktjmp:matrix.orgSoup🙂04:15:08
@kshlm:matrix.orgkshlm invited @kshlm:matrix.kshlm.xyz@kshlm:matrix.kshlm.xyz.04:25:25
@kshlm:matrix.kshlm.xyz@kshlm:matrix.kshlm.xyz joined the room.04:25:49
@b00tr:matrix.orgb00tryeah. I have to really understand how to control paralellism in Flow .. and perhaps a NIF for the histogram compute...04:32:13
@kshlm:matrix.orgkshlm changed their display name from kshlm (Old) to kshlm.04:33:02
@kshlm:matrix.kshlm.xyz@kshlm:matrix.kshlm.xyz left the room.04:35:36
@shreyan:beeper.comshreyan

I'm trying to use the Memento library to store data in Mnesia... unfortunately I get errors when trying to create a table

[error: {:bad_type, Hipdster.Auth.User, {:index, [{2, :ordered}]}}]
05:43:57
@shreyan:beeper.comshreyan *

I'm trying to use the Memento library to store data in Mnesia... unfortunately I get errors when trying to create a table

[error: {:bad_type, Hipdster.Auth.User, {:index, [{2, :ordered}]}}]
05:44:01
@maulik1:matrix.orgmaulik1 joined the room.12:35:54
@b00tr:matrix.orgb00tr
In reply to @shreyan:beeper.com

I'm trying to use the Memento library to store data in Mnesia... unfortunately I get errors when trying to create a table

[error: {:bad_type, Hipdster.Auth.User, {:index, [{2, :ordered}]}}]
I have no clue but I would start from an example that works and incrementally add complexity to achieve your goal. On the way you find the bug.
13:31:18
@b00tr:matrix.orgb00tr

This example works fine for me

defmodule Blog.Post do
  use Memento.Table,
    attributes: [:id, :title, :content, :status, :author_id],
    index: [:status, :author_id],
    type: :ordered_set,
    autoincrement: true


  # You can also define other methods
  # or helper functions in the module
end
13:58:40
@b00tr:matrix.orgb00tr *

This example works fine for me

defmodule Blog.Post do
  use Memento.Table,
    attributes: [:id, :title, :content, :status, :author_id],
    index: [:status, :author_id],
    type: :ordered_set,
    autoincrement: true
end
13:58:57

Show newer messages


Back to Room ListRoom Version: