Skip to content
Converting IP addresses between string and numeric representation in sqlite
C Shell Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
Makefile MinGW support May 23, 2017 Updated the checksums Sep 4, 2017
inet.c Fixed `` detected as malformed ip on windows Aug 29, 2017 Additional test cases for @Animadei fixes Sep 4, 2017


This Sqlite extension provides inet_aton() and inet_ntoa() functions for converting IP adresses between their string and numeric representation.


$ make
$ sqlite3
sqlite> .load bin/inet
sqlite> select inet_ntoa(3232235777);

If you don't want to compile code yourself you can download binaries from here:

Operating System SHA256
Linux 64-bit 0fd7032dd132a26fa44b33777aba1cbd841cada2a3a91aaee9379da84d627cad
Linux 32-bit be1264f95b2d2229ed9250911022ec9f1be89d29919aebc65f72131954e9a946
Windows 64-bit 74202c3c4f13b71c85657c7ed0066eddf82055157d27678d10b27a035c4b8235
Windows 32-bit 5416b902d8c7aa66fdd6ce1619199371f4fabffbf23c047d967fe84fd5718bca


The functions behave like their MariaDB analogs, that is, they expect integers in host byte order, rather than network byte order as expected by C functions. For more info, see this bug report.

When invoked with NULL, NULL is returned.

When invoked with otherwise incorrect data, an error is raised.

You can’t perform that action at this time.