Giter Club home page Giter Club logo

ecto-ulid's People

Contributors

bhicks avatar cdunn avatar dcuddeback avatar jayjun avatar jc00ke avatar markusfeyh avatar xward 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ecto-ulid's Issues

being compatible wih ecto 3.x

the mix.sx forcce ecto version to 2.x, it's propably compatible with 3.x also ?
Thus it can be used with ecto 3.x as it.

Usage question

Since the underlying data type in postgres is uuid DB clients render the ULID as a UUID. I can query using the DB client fine with these IDs, but how do I query for records from within iex

eg. iex(2)> MyApp.Repo.get!(Blog, "<TBD>") I tried a couple of encoding/decoding ideas, but I'm drawing a blank.

:binary_id compatible

I'm trying to use ULIDs as my primary keys in the DB. But when I try to run my Phoenix app Ecto complains about string format of ULID. It seams it cannot

(Ecto.Query.CastError) lib/app/user.ex:55: value `"01F0PBGGWZFR03KSA7H3GKQE6K"` cannot be dumped to type :binary_id in query:

from p0 in Habiter.User.Profile,
  where: p0.user_id == ^"01F0PBGGWZFR03KSA7H3GKQE6K",
  select: p0

I'm giving it id I've got from user already in the DB. It should work but it doesn't. There seams to be an easy fix. Problem is then it wouldn't be an ULID format. But as I've seen in https://github.com/erikreedstrom/ulid repo, it is possible to generate UUID format and work with that.

If there's an interest I'm willing to send you a PR with that. Because I don't think it's efficient to use strings as primary keys.

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.