profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/kevinlang/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Kevin Lang kevinlang @Redfin Seattle, Wa

elixir-sqlite/ecto_sqlite3 89

An Ecto SQLite3 adapter.

elixir-sqlite/exqlite 63

An SQLite3 driver for Elixir

kevinlang/ghost-storage-b2 8

Backblaze B2 storage adapter for Ghost that leverages Cloudflare

kevinlang/armstrong 0

A simple theme for Hugo

kevinlang/beautifulhugo 0

Theme for the Hugo static website generator

kevinlang/borg 0

Deduplicating archiver with compression and authenticated encryption.

kevinlang/DefinitelyTyped 0

The repository for high quality TypeScript type definitions.

kevinlang/digitalgov.gov 0

Digital.gov — Helping the government community deliver better digital services.

kevinlang/ecto 0

A toolkit for data mapping and language integrated query.

startedyuin/goldmark

started time in 2 hours

push eventstatusblog/docs

Kevin Lang

commit sha b452c78318f1fffd76e3ea109f3d6610161c2c58

update contact address

view details

push time in a day

push eventstatusblog/statusblog

Kevin Lang

commit sha 98b4f7ed214dfe2c8c8d0e605034f635ed0f4106

ci

view details

push time in 7 days

push eventstatusblog/statusblog

Kevin Lang

commit sha 453d330a5fe0e09e90f14b220ceee7ea0f6431c0

ci

view details

push time in 7 days

push eventstatusblog/statusblog

Kevin Lang

commit sha 129ca9853bc198c0748a65f38aded8cea9646941

add podman build and docker upload ci

view details

push time in 7 days

push eventstatusblog/statusblog

Kevin Lang

commit sha 1c2f4a8f687edd00828fe0bf1d57e8f37d31ce93

add workflow, fix errors

view details

Kevin Lang

commit sha 575756f18eafc386792d21c3a26eacd28650c192

ci

view details

Kevin Lang

commit sha bbf6648edfac6fca5b660faf97c58971c5a9dc7e

fix components test

view details

Kevin Lang

commit sha 84edf6496c04a40d9d49ac7875592bab522b6a6d

fix formatter

view details

Kevin Lang

commit sha cb6cc9e5f2baf0147f98d0afe139b2783b1fbe58

add credo, enable in ci, fix warnings

view details

Kevin Lang

commit sha bccfab7679e7c6fa50205acd4c29a7f5edf6f4d1

Merge pull request #2 from statusblog/kcl-workflow add workflow, fix errors

view details

push time in 7 days

PR merged statusblog/statusblog

add workflow, fix errors
+96 -55

0 comment

14 changed files

kevinlang

pr closed time in 7 days

push eventstatusblog/statusblog

Kevin Lang

commit sha cb6cc9e5f2baf0147f98d0afe139b2783b1fbe58

add credo, enable in ci, fix warnings

view details

push time in 7 days

push eventstatusblog/statusblog

Kevin Lang

commit sha 84edf6496c04a40d9d49ac7875592bab522b6a6d

fix formatter

view details

push time in 7 days

push eventstatusblog/statusblog

Kevin Lang

commit sha bbf6648edfac6fca5b660faf97c58971c5a9dc7e

fix components test

view details

push time in 7 days

push eventstatusblog/statusblog

Kevin Lang

commit sha 575756f18eafc386792d21c3a26eacd28650c192

ci

view details

push time in 7 days

PR opened statusblog/statusblog

add workflow, fix errors
+64 -32

0 comment

10 changed files

pr created time in 7 days

create barnchstatusblog/statusblog

branch : kcl-workflow

created branch time in 7 days

push eventstatusblog/statusblog

Kevin Lang

commit sha 7eefa37b0ea23817e9888cebabc2267d2971f7bd

add nodejs to .tools-versions

view details

push time in 7 days

push eventstatusblog/statusblog

Kevin Lang

commit sha 4b4d9f351cbc073e1a5bb75425328dd5c026868f

run mix format

view details

Kevin Lang

commit sha d64efda72fe2ae67ae2262f8dbf0b8d2ea65abf1

Merge pull request #1 from statusblog/kcl-format run mix format

view details

push time in 7 days

PR merged statusblog/statusblog

run mix format
+513 -247

0 comment

56 changed files

kevinlang

pr closed time in 7 days

PR opened statusblog/statusblog

run mix format
+513 -247

0 comment

56 changed files

pr created time in 7 days

create barnchstatusblog/statusblog

branch : kcl-format

created branch time in 7 days

push eventstatusblog/statusblog

Kevin Lang

commit sha e9dd2d676dd5538639106d502be32582bc7174d6

add SES config and adapter

view details

push time in 8 days

push eventstatusblog/statusblog

Kevin Lang

commit sha 6e8fdd97ea7642c68e1df6ed24af092217250ec8

setup sentry for statublog and statusblog_web apps

view details

push time in 8 days

push eventstatusblog/statusblog

Kevin Lang

commit sha 3a320974020d7a79197bda9a4cb4dbef0565e056

run migrations on container start

view details

push time in 9 days

issue openedphoenixframework/phoenix

IPv6 default for Ecto repository causes issues with specifying IPv4 address in database url

<!--

Precheck

  • For general discussions and support, use Stack Overflow or the Elixir Forum
  • For proposing and discussing new features, start a thread on the Phoenix Core mailing list
  • For bugs, do a quick search and make sure the bug has not yet been reported
  • Ensure that this issue is related to the Phoenix library and not one of the dependencies listed in mix.exs (Ecto, Plug, etc.)
  • All checked? Be nice and have fun! -->

In #4289 IPv6 was enabled for all Ecto repos by default via the phx.new generator. Unfortunately, this leads to no longer being able to specify an IPv4 address as the hostname. Doing so leads to an opaque :nxdomain failure.

Environment

  • Elixir version (elixir -v): 1.12.2
  • Phoenix version (mix deps): master
  • Node.js version (node -v): not relevant
  • Operating system: Fedora 34

Expected behavior

The addition of socket_opts: [:inet6] in the Ecto config does not break specifying an IPv4 ip address as the hostname in the DATABASE_URL.

Actual behavior

If one sets socket_opts: [:inet6], the underlying socket can no longer resolve IPv4 addresses, that may be passed in directly in lieu of an actual host.

For example, with postgres running locally:

Mix.install([:postgrex])

# works fine
{:ok, pid} = Postgrex.start_link(hostname: "127.0.0.1", username: "postgres", password: "postgres", database: "postgres")

# no longer works!
{:ok, pid} = Postgrex.start_link(socket_options: [:inet6], hostname: "127.0.0.1", username: "postgres", password: "postgres", database: "postgres")
21:34:38.510 [error] Postgrex.Protocol (#PID<0.209.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (127.0.0.1:5432): non-existing domain - :nxdomain

Of course, in the above example I could use localhost instead, and it would work. However, in my specific scenario, what I was trying to do was communicate between two containers via their respective internal IPv4 addresses. It is not uncommon to use IPv4 address directly instead of a hostname, for things like databases.

From briefly looking at the underlying db_connection code, it looks like those options that are configured in the Repo config eventually get handed off to :gen_tcp.

I'm unsure where this should be filed, so I filed it here since I would have not encountered this issue without that recent change of #4289. The fix can be in a variety of different places:

  1. Revert #4289
  2. File an issue upstream on :gen_tcp
  3. Warn the :ecto library about this case when the hostname is detected as being IPv4 but socket_opts: [:inet6]

created time in 9 days

issue commentelixir-sqlite/exqlite

Add Windows CI

Looks like this is unblocked now.

https://github.com/erlef/setup-beam/issues/51

kevinlang

comment created time in 9 days

issue commentelixir-sqlite/ecto_sqlite3

Ecto expectations for map fields

Yep, I think (1) would not work. I'm not too familiar with ParamaterizedTypes, but reading through briefly I now understand that ultimately your library is its own "type", so we wouldn't have any loader to process it anyway.

I agree that (2) seems the way to go, if we do not want to make changes to exqlite (I defer to @warmwaffles on that one).


@warmwaffles I don't think it is an issue with the MySQL driver, based on this file: https://github.com/elixir-ecto/myxql/blob/fdb147dba07d7699c4af23448996ae7f4663bce6/lib/myxql/protocol/values.ex

There I see that the driver is encoding the json column response directly into an Elixir map, so the ParamaterizedType would get that value to process on load.

rupurt

comment created time in 10 days

issue commentelixir-sqlite/ecto_sqlite3

Support Ecto.Changeset.foreign_key_constraint/3 ?

I've added some documentation about this limitation that points back to this issue.

jjcarstens

comment created time in 10 days

push eventelixir-sqlite/ecto_sqlite3

Kevin Lang

commit sha 5f5cd892a89928c8c514cc086b9444d9c4e46890

typo

view details

push time in 10 days

push eventelixir-sqlite/ecto_sqlite3

Kevin Lang

commit sha ba3489bf403a97a2d4bd2234d454d93f92bbc87a

add note about foreign key constraints for #42

view details

push time in 10 days

issue closedelixir-sqlite/ecto_sqlite3

Support Ecto.Changeset.foreign_key_constraint/3 ?

I have a relational setup that I would like to just give me an {:error, changeset} tuple back for when the foreign record doesn't exist. However, no matter what I put I always get this error:

14:02:56.563 [error] Task #PID<0.559.0> started from #PID<0.557.0> terminating
** (Ecto.ConstraintError) constraint error when attempting to insert struct:

    *  (foreign_key_constraint)

If you would like to stop this constraint violation from raising an
exception and instead add it as an error to your changeset, please
call `foreign_key_constraint/3` on your changeset with the constraint
`:name` as an option.

The changeset defined the following constraints:

    * intervals_schedule_id_fkey (foreign_key_constraint)

...

If I'm understanding right, SQLite knows there is a constraint here, but its unnamed and so all we get back to help is an empty * (foreign_key_constraint) clue. And since there is no name to match on, Ecto can't reconcile it and things just crash. I've even tried using the name: "" option, but I think Ecto just ignores the empty string.

Is it even possible to get around this or are we limited by the abilities of SQLite here? I do understand I can use the foreign_key: :off option in the adapter to just skip validations entirely which is currently my workaround, but I would love to get the {:error, changeset} return instead.

Caveat: I am in no way a DB expert and this could be 100% user error. My migrations are simple and would love to know if Im just doing things wrong:

create table(:schedules) do
  add :name, :string
end

create table(:intervals) do
  add :schedule, references(:schedules)
end

closed time in 10 days

jjcarstens

issue commentelixir-sqlite/ecto_sqlite3

Support Ecto.Changeset.foreign_key_constraint/3 ?

For reference, here is what we get back from SQLite3 and thus why we cannot really do anything:

sqlite> pragma foreign_keys=on;
sqlite> create table a(b integer not null primary key); 
sqlite> create table c(d references a(b));
sqlite> insert into c values(1);
Error: FOREIGN KEY constraint failed

No mention of which constraint failed. See https://sqlite.org/forum/forumpost/b17fdd0d59 for examples on other types of constraints.

jjcarstens

comment created time in 10 days

issue commentelixir-sqlite/ecto_sqlite3

Support Ecto.Changeset.foreign_key_constraint/3 ?

Yeah this is a SQLite3 issue. See this issue for more details: https://github.com/elixir-sqlite/ecto_sqlite3/issues/28

We have a hack that works for some cases. I believe I tried adapting that hack for foreign keys in the above issue, but failed.

I encourage you to post a request on the SQLite3 forum asking for some sort of API from SQLite3 so we can support this! :smile:

In the meantime, I'll try thinking about whether there may be other hacks we can do. I'll play around a bit an re-open this if I find a new approach. I'll also update the docs to make this a known limitation.

jjcarstens

comment created time in 10 days