-
Notifications
You must be signed in to change notification settings - Fork 194
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for directly providing ODBC DNS #28
Closed
Closed
Changes from all commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
83992a4
Support for directly providing ODBC DNS
blumf 0a69e30
Merge remote-tracking branch 'upstream/master'
blumf 2ab1e68
Update README
blumf 2ce67ee
Bumping version and copyright notes
blumf c300729
New table helper functions
blumf 0c06ede
Avoided use of strcpy and sprintf
blumf 2a65a4b
Convert Firebird driver to use table for connection
blumf 3e6a06e
All drivers use same table
blumf 862be2a
Connect now supports 'charset'
blumf c4a5d2f
Document change in comment
blumf 342e875
Renamed functions to avoid confusion
blumf e3d3898
Firebird driver supports basic prepared statements
blumf 2be82a8
Firebird SQL dialect config
blumf 7aa596e
Protecting against buffer overrun
blumf cffa10b
Execute now accepts parameters
blumf 9327b23
Proper cursor handling
blumf b4fd2b4
Proper statement handling
blumf 507fe0c
Close none cursor statements
blumf 36b6a08
Using unambiguous date format
blumf 5b79d90
Parameters now take os.time values
blumf 65bfb3d
Neaten up parameter fill code
blumf f405cb8
Force close of statements used internally
blumf 7a709dc
Using uchar for holding bool value
blumf 2e20062
Scratch prev commit
blumf 2a4a816
Unified a bunch of memory code
blumf 2eb89ba
Merge branch 'upstream/master'
blumf 1bb7db1
Tidied up ODBC's env:connect functions
blumf fc1ac8b
Create concept of statements
blumf 8af1e32
Format tidy up
blumf f7f9169
Move (un)registerobj functions into wider library
blumf cb62a5e
Using more direct locking
blumf 67ba726
Added con:prepare function
blumf 8b82654
Fixed stmt:close
blumf 1a434d7
Split up ODBC execution steps
blumf fbb6245
ODBC stmt:execute now runs
blumf fc220a5
ODBC stmt:getparamtypes function support
blumf 3dd893e
Tidy up recent code changes
blumf f6ee06d
First stab at ODBC parameter binding
blumf bc252b2
ODBC con:execute now accepts parameters
blumf 4d90417
ODBC supports NULL & bool params
blumf 6f41ec6
Moved luasql_pushinteger into wider project
blumf 0e770ca
Return whole number for SQL update statements
blumf 22cebe4
ODBC Cursor now closes itself when out of results
blumf 210e800
Better method to fix old connection calls
blumf d6b8f1a
Function in wrong place
blumf 9241007
MySQL driver supports new env:connect style
blumf e4e14f4
Tidy up some compiler warnings
blumf d8702e4
Ran file through beautifier
blumf be804c6
Ran file through beautifier
blumf 87e0475
Ran file through beautifier
blumf 4edf87b
Using C99 for now
blumf 721822f
Ran file through beautifier
blumf 4f39b91
More tidying
blumf 2c99c56
Created statement object for MySQL driver
blumf 1a6e57a
Sorted out differences between driver reg on 5.1/5.3
blumf 66d924d
Using wrong count in XSQLDA field
blumf 81eb6c1
ODBC function to list available drivers
blumf 817e8ad
More tidying
blumf f077127
Progress on the MySQL driver statement support
blumf 76c4cc3
Merge branch 'MySQL_WIP'
blumf c5ad4a3
Added includes to luasql.h
blumf 0a2c974
Improved *nix makefile
blumf 28f3b3e
Pre-definition to avoid compiler warning
blumf e484b48
MySQL now uses statements directly
blumf 60d2635
Wasn't creating a new connection object
blumf 66bbede
Removed unused var
blumf 8d45355
Merge branch 'master' of https://github.com/keplerproject/luasql
blumf 2900df6
Platform agnostic column buffers
blumf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,39 @@ | ||
V= 2.3.0 | ||
V= 3.0.0 | ||
CONFIG= ./config | ||
|
||
include $(CONFIG) | ||
|
||
OBJS= src/luasql.o src/ls_$T.o | ||
OBJS= src/luasql.o | ||
SRCS= src/luasql.h src/luasql.c | ||
|
||
# list of all driver names | ||
DRIVER_LIST= $(subst src/ls_,,$(basename $(wildcard src/ls_*.c))) | ||
|
||
SRCS= src/luasql.h src/luasql.c \ | ||
src/ls_firebird.c \ | ||
src/ls_postgres.c \ | ||
src/ls_odbc.c \ | ||
src/ls_oci8.c \ | ||
src/ls_mysql.c \ | ||
src/ls_sqlite.c \ | ||
src/ls_sqlite3.c | ||
# used for help formatting | ||
EMPTY= | ||
SPACE= $(EMPTY) $(EMPTY) | ||
|
||
AR= ar rcu | ||
RANLIB= ranlib | ||
all : | ||
@echo "usage: make { $(subst $(SPACE),$(SPACE)|$(SPACE),$(DRIVER_LIST)) }" | ||
|
||
# explicity matches against the list of avilable driver names | ||
$(DRIVER_LIST) : % : src/%.so | ||
|
||
lib: src/$(LIBNAME) | ||
# builds the specified driver | ||
src/%.so : src/ls_%.c $(OBJS) | ||
$(CC) $(CFLAGS) src/ls_$*.c -o $@ $(LIB_OPTION) $(OBJS) $(DRIVER_INCS_$*) $(DRIVER_LIBS_$*) | ||
|
||
src/$(LIBNAME): $(OBJS) | ||
export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) $(CFLAGS) -o $@ $(LIB_OPTION) $(OBJS) $(DRIVER_LIBS) | ||
# builds the general LuaSQL functions | ||
$(OBJS) : $(SRCS) | ||
$(CC) $(CFLAGS) -c src/luasql.c -o src/luasql.o | ||
|
||
install: | ||
mkdir -p $(LUA_LIBDIR)/luasql | ||
cp src/$(LIBNAME) $(LUA_LIBDIR)/luasql | ||
cp src/*.so $(LUA_LIBDIR)/luasql | ||
|
||
jdbc_driver: | ||
cd src/jdbc; make $@ | ||
|
||
clean: | ||
rm -f src/$(LIBNAME) src/*.o | ||
rm -f src/*.so src/*.o | ||
|
||
# $Id: Makefile,v 1.56 2008/05/30 17:21:18 tomas Exp $ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# LuaSQL 3.0 (proposed) | ||
http://www.keplerproject.org/luasql/ | ||
https://github.com/keplerproject/luasql/ | ||
|
||
LuaSQL is a simple interface from Lua to a DBMS. It enables a Lua program to: | ||
|
||
* Connect to ODBC, ADO, Oracle, MySQL, SQLite and PostgreSQL databases; | ||
* Execute arbitrary SQL statements; | ||
* Retrieve results in a row-by-row cursor fashion. | ||
|
||
LuaSQL is free software and uses the same license as Lua 5.1. | ||
|
||
Source code for LuaSQL can be downloaded from the Kepler Project Github page. | ||
|
||
- - - | ||
|
||
## LuaSQL 3.0.0 [09/Apr/2015] | ||
This is a proposed branch to add much needed features | ||
* Prepared statements with parameters | ||
+ Really a major requirement for any DB system that takes data from the web | ||
* More flexible connection method | ||
+ Current method of just passing DB name/path with user name+password is not enough to support the complexities of connecting to a DB | ||
* Explicit handling of BLOB fields (? maybe) | ||
+ It might be useful to handle true binary data from BLOB fields rather than blindly convert them to Lua strings | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,54 @@ | ||
# $Id: config,v 1.10 2008/05/30 17:21:18 tomas Exp $ | ||
|
||
# Driver (leave uncommented ONLY the line with the name of the driver) | ||
T= mysql | ||
#T= oci8 | ||
#T= odbc | ||
#T= postgres | ||
#T= sqlite | ||
#T=sqlite3 | ||
#T=firebird | ||
|
||
# Installation directories | ||
|
||
# Default prefix | ||
PREFIX = /usr/local | ||
|
||
# System's libraries directory (where binary libraries are installed) | ||
LUA_LIBDIR= $(PREFIX)/lib/lua/5.1 | ||
|
||
# System's lua directory (where Lua libraries are installed) | ||
LUA_DIR= $(PREFIX)/share/lua/5.1 | ||
|
||
# Lua includes directory | ||
LUA_INC= $(PREFIX)/include | ||
PREFIX ?= /usr | ||
|
||
# Lua version number (first and second digits of target version) | ||
LUA_VERSION_NUM= 501 | ||
# Lua version and dirs | ||
LUA_SYS_VER ?= 5.2 | ||
LUA_LIBDIR ?= $(PREFIX)/lib/lua/$(LUA_SYS_VER) | ||
LUA_DIR ?= $(PREFIX)/share/lua/$(LUA_SYS_VER) | ||
LUA_INC ?= $(PREFIX)/include/lua$(LUA_SYS_VER) | ||
|
||
# OS dependent | ||
LIB_OPTION= -shared #for Linux | ||
#LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS X | ||
|
||
LIBNAME= $T.so | ||
|
||
# Compilation parameters | ||
# Driver specific | ||
######## MySQL | ||
#DRIVER_LIBS= -L/usr/local/mysql/lib -lmysqlclient -lz | ||
#DRIVER_INCS= -I/usr/local/mysql/include | ||
DRIVER_LIBS= -L/usr/lib -lmysqlclient -lz | ||
DRIVER_INCS= -I/usr/include/mysql | ||
######## Oracle OCI8 | ||
#DRIVER_LIBS= -L/home/oracle/OraHome1/lib -lz -lclntsh | ||
#DRIVER_INCS= -I/home/oracle/OraHome1/rdbms/demo -I/home/oracle/OraHome1/rdbms/public | ||
######## PostgreSQL | ||
#DRIVER_LIBS= -L/usr/local/pgsql/lib -lpq | ||
#DRIVER_INCS= -I/usr/local/pgsql/include/ | ||
#DRIVER_LIBS= -L/usr/lib -lpq | ||
#DRIVER_INCS= -I/usr/include/postgresql | ||
######## SQLite | ||
#DRIVER_LIBS= -lsqlite | ||
#DRIVER_INCS= | ||
######## SQLite3 | ||
#DRIVER_LIBS= -L/opt/local/lib -lsqlite3 | ||
#DRIVER_INCS= -I/opt/local/include | ||
######## ODBC | ||
#DRIVER_LIBS= -L/usr/local/lib -lodbc | ||
#DRIVER_INCS= -DUNIXODBC -I/usr/local/include | ||
######## Firebird | ||
#DRIVER_LIBS= -L/usr/local/firebird -lfbclient | ||
#DRIVER_INCS= | ||
|
||
WARN= -Wall -Wmissing-prototypes -Wmissing-declarations -ansi -pedantic | ||
INCS= -I$(LUA_INC) | ||
CFLAGS= -O2 $(WARN) -fPIC $(DRIVER_INCS) $(INCS) -DLUASQL_VERSION_NUMBER='"$V"' $(DEFS) | ||
UNAME_S := $(shell uname -s) | ||
ifeq ($(UNAME_S),Darwin) # MacOS | ||
LIB_OPTION ?= -bundle -undefined dynamic_lookup -mmacosx-version-min=10.3 | ||
else # Linux/BSD | ||
LIB_OPTION ?= -shared | ||
endif | ||
|
||
# driver specific params | ||
# - MySQL | ||
#DRIVER_LIBS_mysql ?= -L/usr/local/mysql/lib -lmysqlclient -lz | ||
#DRIVER_INCS_mysql ?= -I/usr/local/mysql/include | ||
DRIVER_LIBS_mysql ?= -L/usr/lib -lmysqlclient -lz | ||
DRIVER_INCS_mysql ?= -I/usr/include/mysql | ||
# - Oracle OCI8 | ||
DRIVER_LIBS_oci8 ?= -L/home/oracle/OraHome1/lib -lz -lclntsh | ||
DRIVER_INCS_oci8 ?= -I/home/oracle/OraHome1/rdbms/demo \ | ||
-I/home/oracle/OraHome1/rdbms/public | ||
# - PostgreSQL | ||
#DRIVER_LIBS_postgres ?= -L/usr/local/pgsql/lib -lpq | ||
#DRIVER_INCS_postgres ?= -I/usr/local/pgsql/include/ | ||
DRIVER_LIBS_postgres ?= -L/usr/lib -lpq | ||
DRIVER_INCS_postgres ?= -I/usr/include/postgresql | ||
# - SQLite | ||
DRIVER_LIBS_sqlite ?= -lsqlite | ||
DRIVER_INCS_sqlite ?= | ||
# - SQLite3 | ||
DRIVER_LIBS_sqlite3 ?= -L/opt/local/lib -lsqlite3 | ||
DRIVER_INCS_sqlite3 ?= -I/opt/local/include | ||
# - ODBC | ||
DRIVER_LIBS_odbc ?= -L/usr/local/lib -lodbc | ||
DRIVER_INCS_odbc ?= -DUNIXODBC -I/usr/local/include | ||
# - Firebird | ||
DRIVER_LIBS_firebird ?= -L/usr/local/firebird -lfbclient | ||
DRIVER_INCS_firebird ?= | ||
|
||
# general compilation parameters | ||
WARN = -Wall -Wmissing-prototypes -Wmissing-declarations -pedantic | ||
INCS = -I$(LUA_INC) | ||
DEFS = | ||
CFLAGS = -O2 -std=gnu99 $(WARN) -fPIC $(DRIVER_INCS) $(INCS) \ | ||
-DLUASQL_VERSION_NUMBER='"$V"' $(DEFS) | ||
CC= gcc | ||
|
||
# $Id: config,v 1.10 2008/05/30 17:21:18 tomas Exp $ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not qualified to comment on the LuaSQL codebase, but...
Should this type of comments be merged into the README? These "proposed" comments here seem appropriate for the PR text, not to the user-facing documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, shouldn't have been there. I'll redo the pull req neater next week.