Skip to content
This repository was archived by the owner on Apr 26, 2019. It is now read-only.
This repository was archived by the owner on Apr 26, 2019. It is now read-only.

add postgres support #16

@zilkey

Description

@zilkey

I'd like to use experimental, but I'm on postgres. It does not seem to be trivial to convert the existing mysql functions to postgres, but I have a version that seems to be equivalent.

The ruby version is:

top_8 = Digest::MD5.hexdigest("#{experiment_name}#{user.id}")[0...16]
top_8.to_i(16) % num_buckets

The SQL version is:

select abs(('x'|| substr(md5('experiment-name' || id),1,16))::bit(64)::bigint) % 2 from users;

Are there any plans to include different database adapters in this gem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions