Re: [sqlite] Have SQLite handle values of my own type

2019-05-24 Thread Andy Bennett
Hi, IP addresses are easy: convert to the form aaa.bbb.ccc.ddd where each of the four parts is always three digits long. IPv4 addresses are 32bit unsigned integers internally. The dotted -quad notation is 4 8bit unsigned integers that get concatenated together. If you store them as a 32bit

Re: [sqlite] Have SQLite handle values of my own type

2019-05-24 Thread Peter da Silva
Windows TCP/IP userland used to be a port of the BSD networking tools (I think via Lachman Associates) so that's not surprising. Allegedly they reimplemented it at some point. On Thu, May 23, 2019 at 3:57 PM Keith Medcalf wrote: > On Thursday, 23 May, 2019 08:35, Dominique Devienne > wrote: >

Re: [sqlite] Have SQLite handle values of my own type

2019-05-23 Thread Keith Medcalf
On Thursday, 23 May, 2019 08:35, Dominique Devienne wrote: >On Thu, May 23, 2019 at 3:50 PM Jose Isaias Cabrera > wrote: > >> I have been working network for a long time, and I have never seen >> any application that takes "zeroed left-filled" IP addresses. Just >> sharing... >> Thanks. >

Re: [sqlite] Have SQLite handle values of my own type

2019-05-23 Thread Simon Slavin
On 23 May 2019, at 12:02pm, Dominique Devienne wrote: > On Thu, May 23, 2019 at 12:37 PM Simon Slavin wrote: > >> IP addresses are easy: convert to the form aaa.bbb.ccc.ddd where each of the >> four parts is always three digits long. > > Sure. But representing it as 001.001.001.001 for

Re: [sqlite] Have SQLite handle values of my own type

2019-05-23 Thread Dominique Devienne
On Thu, May 23, 2019 at 5:14 PM Jen Pollock wrote: > This is getting pretty far off topic, but I think at least some tools > will interpret values with leading zeroes as octal, which means 001 is > the same as 1, but 010 isn't 10, it's 8. > Good catch! That's indeed what's happening. Win7 BTW.

Re: [sqlite] Have SQLite handle values of my own type

2019-05-23 Thread Jen Pollock
This is getting pretty far off topic, but I think at least some tools will interpret values with leading zeroes as octal, which means 001 is the same as 1, but 010 isn't 10, it's 8. On Thu, May 23, 2019 at 04:35:02PM +0200, Dominique Devienne wrote: > On Thu, May 23, 2019 at 3:50 PM Jose Isaias

Re: [sqlite] Have SQLite handle values of my own type

2019-05-23 Thread Jose Isaias Cabrera
Dominique Devienne, on Thursday, May 23, 2019 10:35 AM, wrote... >On Thu, May 23, 2019 at 3:50 PM Jose Isaias Cabrera >wrote: > >Works for me with a .001 at least, as shown below. But that wasn't really >the point I was making, FWIW. --DD > >C:\Users\ddevienne>ping 192.168.223.001 > >Pinging

Re: [sqlite] Have SQLite handle values of my own type

2019-05-23 Thread Dominique Devienne
On Thu, May 23, 2019 at 3:50 PM Jose Isaias Cabrera wrote: > I have been working network for a long time, and I have never seen any > application that takes "zeroed left-filled" IP addresses. Just sharing... > Thanks. > Works for me with a .001 at least, as shown below. But that wasn't really

Re: [sqlite] Have SQLite handle values of my own type

2019-05-23 Thread Jose Isaias Cabrera
Dominique Devienne, on Thursday, May 23, 2019 07:02 AM, wrote... >On Thu, May 23, 2019 at 12:37 PM Simon Slavin wrote: >> On 23 May 2019, at 3:55am, Keith Medcalf wrote: >> > Technically, COLLATE only works on TEXT. Most people declare their own >> types as binary blobs and the programmer has

Re: [sqlite] Have SQLite handle values of my own type

2019-05-23 Thread Shawn Wagner
Don't forget IPv6 addresses. On Thu, May 23, 2019, 3:37 AM Simon Slavin wrote: > On 23 May 2019, at 3:55am, Keith Medcalf wrote: > > > Technically, COLLATE only works on TEXT. Most people declare their own > types as binary blobs and the programmer has to keep track of what is in > there and

Re: [sqlite] Have SQLite handle values of my own type

2019-05-23 Thread Dominique Devienne
On Thu, May 23, 2019 at 12:37 PM Simon Slavin wrote: > On 23 May 2019, at 3:55am, Keith Medcalf wrote: > > Technically, COLLATE only works on TEXT. Most people declare their own > types as binary blobs and the programmer has to keep track of what is in > there and how to work with it. > > So

Re: [sqlite] Have SQLite handle values of my own type

2019-05-23 Thread Simon Slavin
On 23 May 2019, at 3:55am, Keith Medcalf wrote: > Technically, COLLATE only works on TEXT. Most people declare their own types > as binary blobs and the programmer has to keep track of what is in there and > how to work with it. So it would seem that rather than define a function which

Re: [sqlite] Have SQLite handle values of my own type

2019-05-22 Thread Keith Medcalf
On Wednesday, 22 May, 2019 19:06, Simon Slavin wrote: >Since there are people posting who appear know about these things … >Suppose I want SQlite to handle my own type. Or to do its best to >simulate that. IP address, x/y location, something like that. What >should I be doing ? Do I store

[sqlite] Have SQLite handle values of my own type

2019-05-22 Thread Simon Slavin
Since there are people posting who appear know about these things … Suppose I want SQlite to handle my own type. Or to do its best to simulate that. IP address, x/y location, something like that. What should I be doing ? Do I store BLOBs and define my own COLLATEs ? Or didn't I read