Thanks @NobbZ, Maybe, I didn’t give the full situation properly, Let me get this clear,
I have a bit string like b = <<23, 102, 34>>
I’m want to store it as bits in Postgres, so I’m using the next step:
a = for <<c::1 <- b>>, do: <<a::1>>
gives me this,
[
<<0::size(1)>>,
<<0::size(1)>>,
<<0::size(1)>>,
<<1::size(1)>>,
<<0::size(1)>>,
<<1::size(1)>>,
<<1::size(1)>>,
<<1::size(1)>>,
<<0::size(1)>>,
<<1::size(1)>>,
<<1::size(1)>>,
<<0::size(1)>>,
<<0::size(1)>>,
<<1::size(1)>>,
<<1::size(1)>>,
<<0::size(1)>>,
<<0::size(1)>>,
<<0::size(1)>>,
<<1::size(1)>>,
<<0::size(1)>>,
<<0::size(1)>>,
<<0::size(1)>>,
<<1::size(1)>>,
<<0::size(1)>>
]
I want to store it as bits in the Postgres and What is the correct way to save them as 1-bit bitstring rather than saving it as list of 1-bit binary?
The problem here is I’m trying to understand if I can send bit data as it is through ecto get it stored in Postgres as bit varying
Thanks in advance for explaining the size operation.