Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make map/array encoding configurable#163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@a-nassim
Copy link
Contributor

Closes#162

This PR adds:

  1. :map_type config option to determine how:map columns are stored (:string or:binary)
  2. :array_type config option for:array columns (also:string or:binary)
    • I thought this would make sense since:array columns are also serialized using JSON

Both default to:string, the:binary option enables SQLite'sJSONB storage format.

I tried to be consistent with other configurable types in this project like:uuid that is why it is not implemented the exact same way as in the Postgres adapter.

@warmwaffles
Copy link
Member

Yea this looks great!

storage format.
* `:array_type` - Defaults to `:string`. Determines the type of `:array` columns.
Arrays are serialized using JSON. Set to `:binary` to use the
[JSONB](https://sqlite.org/draft/jsonb.html) storage format.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
[JSONB](https://sqlite.org/draft/jsonb.html)storageformat.
[JSONB](https://sqlite.org/jsonb.html)storageformat.

Possible values and column types are the same as for
[binary IDs](#module-binary-id-types).
* `:map_type` - Defaults to `:string`. Determines the type of `:map` columns.
Set to `:binary` to use the [JSONB](https://sqlite.org/draft/jsonb.html)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Let's point at the official docs and not the draft.

Suggested change
Set to `:binary`tousethe[JSONB](https://sqlite.org/draft/jsonb.html)
Set to `:binary`tousethe[JSONB](https://sqlite.org/jsonb.html)

a-nassim reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Oops I missed that, fixed!

@a-nassima-nassimforce-pushed theconfigurable-map-encoding branch fromd21f7f4 toffeaeffCompareMarch 19, 2025 02:19
@warmwaffleswarmwaffles merged commit952f38b intoelixir-sqlite:mainMar 19, 2025
21 of 22 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@warmwaffleswarmwaffleswarmwaffles approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Make map encoding configurable

2 participants

@a-nassim@warmwaffles

[8]ページ先頭

©2009-2025 Movatter.jp