sqlines icon indicating copy to clipboard operation
sqlines copied to clipboard

Compiling sqlines On Mac OS X

Open techxplorer opened this issue 8 years ago • 3 comments

Hi,

Thanks for taking the time to develop this tool and making it open source. I really appreciate it.

I tried compile the sqlines binary on my Mac OS X machine and have a small issue that I hope you can help with.

My compiler is as follows:

$ g++ -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

If I run the build_all64.sh script all of the source files compile except for the ones that reference the #include <sys/io.h> header.

This header doesn't appear to be available on Mac OS X machines.

If I comment out the reference to this header, the files compile as expected, and the sqlines binary appears to work. I was able to use the binary to convert a SQL script from Oracle to MySQL syntax.

This is a long way of asking, am I potentially breaking anything by commenting out references to this header?

With many thanks for your time.

-Corey

techxplorer avatar Nov 30 '16 23:11 techxplorer

Hi Corey,

It was added to compile on Linux, and if it compiles after you removed <sys/io.h> that it should be fine. Also you can try <sys/uio.h> that is available on Mac OS X.

Thanks, Dmitry

dmtolpeko avatar Dec 01 '16 05:12 dmtolpeko

Looks like a fork added this although I didn't test it - https://github.com/andrewmacheret/sqlines/commit/ba512aea20a691e71594835bd2926db3c27045e9

ryanrupp avatar Jun 15 '17 02:06 ryanrupp

I was able to successfully build the fork in the previous comment and run it. I tried this command: ./sqlines -s=sql -t=mysql -in="~/Downloads/esp_tables.sql" -out="~/Desktop"

The log has no errors, but no sign of an output file.

SQLines 3.1.1 - SQL Conversion Tool.
Copyright (c) 2017 SQLines. All Rights Reserved.

Source file: 1 (2.7 MB)

    1. /Users/*****/Downloads/esp_tables.sql...Ok (2.7 MB, 41978 lines, 2.1 sec)

Total: 1 file, 2.7 MB, 41978 lines, 2.1 sec

spamguy avatar Jan 19 '18 17:01 spamguy