Coder Social home page Coder Social logo

exnumerator's Introduction

Hi there ๐Ÿ‘‹

My name is Kamil Lelonek, I come from Poland, and I'm a Technical Team Lead & Software Engineer.

I can help you with the following:

  • Team leading
  • Project management
  • Business development
  • Software architecture
  • System infrastructure
  • Elixir programming

I have over six years experience in the areas above (and 12 years overall), so do not hesitate to contact me if you need such skills.

exnumerator's People

Contributors

ajmath avatar danielberkompas avatar darkbaby123 avatar hl avatar jung-hunsoo avatar kamillelonek avatar mbenatti avatar michalmuskala avatar yordis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

exnumerator's Issues

Keyword lists

I'm working with a legacy database that has a status column with single-character values. I would prefer to represent this with an enum so I can use descriptive words as values.

defmodule MyType do
  use Exnumerator, values: [active: "A", inactive: "I", pending: "P"]
end

I've implemented this myself as:

  defmodule Status do
    @behaviour Ecto.Type
    @values [active: "A", pending: "P", inactive: "I"]

    def type, do: :string
    def values, do: @values

    for {name, value} <- @values do
      def cast(unquote(name)), do: {:ok, unquote(name)}
      def cast(unquote(value)), do: {:ok, unquote(name)}
      def load(unquote(value)), do: {:ok, unquote(name)}
      def dump(unquote(name)), do: {:ok, unquote(value)}
      def dump(unquote(value)), do: {:ok, unquote(value)}
    end

    def cast(_), do: :error
    def load(_), do: :error
    def dump(_), do: :error
  end

Fix dependecies

I am getting this because your package have ex_doc in prod as you can see and my dependency is only for dev

* ex_doc (Hex package)
  the :only option for dependency ex_doc

  > In mix.exs:
    {:ex_doc, ">= 0.0.0", [env: :prod, repo: "hexpm", hex: "ex_doc", only: :dev, runtime: false, manager: :mix]}

  does not match the :only option calculated for

  > In deps/exnumerator/mix.exs:
    {:ex_doc, ">= 0.0.0", [env: :prod, hex: "ex_doc", repo: "hexpm", optional: false]}

  Remove the :only restriction from your dep
** (Mix) Can't continue due to errors on dependencies

I understand what you are doing with mix.exs and deps but it is failing so

How about map values with string instead of atom?

I'm trying exnumerator now, and found that only atom type is allowed for the values which string doesn't.

Since it won't harm the functionality, it'd be better using with string not to consume erlang's atom limitation.

While the developers feel comfortable with atom logically, which the name itself represent their values are atomic, the DB will likely have its values with string physically. And even we no more need to use :erlang.atom_to_binary/2, right?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.