Move sources into their own subdirectory, assorted cleaning.

This commit is contained in:
Dimitri Fontaine 2013-10-20 19:09:09 +02:00
parent 031c62c663
commit fb818ee0e3
21 changed files with 39 additions and 34 deletions

4
.gitignore vendored
View File

@ -1,2 +1,2 @@
galaxya
csv
.vagrant
local-data

View File

@ -31,7 +31,7 @@ git clone -b empty-strings-and-nil https://github.com/dimitri/cl-csv.git
git clone https://github.com/marijnh/Postmodern.git
cd ~/quicklisp/local-projects/Postmodern/
patch -p1 < /vagrant/postmodern-send-copy-done.patch
patch -p1 < /vagrant/patches/postmodern-send-copy-done.patch
cd ~
@ -55,7 +55,7 @@ echo "(:tree \"/vagrant/\")" > $REGISTRY/projects.conf
# --load-system pgloader \
# --entry pgloader:main \
# --dynamic-space-size 4096 \
# --output pgloader.exe
# --output /home/vagrant/pgloader.exe
echo "TESTING"
@ -63,7 +63,8 @@ echo "TESTING"
for test in /vagrant/test/*.load
do
echo " TEST: $test"
echo "# TEST: $test"
echo
/vagrant/pgloader.lisp $test
echo
done

View File

@ -1,34 +1,37 @@
;;;; pgloader.asd
(asdf:defsystem #:pgloader
:serial t
:description "Load data into PostgreSQL"
:author "Dimitri Fontaine <dimitri@2ndQuadrant.fr>"
:license "The PostgreSQL Licence"
:depends-on (#:uiop ; host system integration
#:cl-log ; logging
#:postmodern ; PostgreSQL protocol implementation
#:cl-postgres ; low level bits for COPY streaming
#:simple-date ; FIXME: recheck dependency
#:cl-mysql ; CFFI binding to libmysqlclient-dev
#:split-sequence ; some parsing is made easy
#:cl-csv ; full CSV reader
#:cl-fad ; file and directories
#:lparallel ; threads, workers, queues
#:esrap ; parser generator
#:alexandria ; utils
#:drakma ; http client, download archives
#:zip ; support for zip archive files
#:flexi-streams ; streams
#:com.informatimago.clext ; portable character-sets listings
#:usocket ; UDP / syslog
#:local-time ; UDP date parsing
#:command-line-arguments ; for the main function
#:abnf ; ABNF parser generator (for syslog)
#:db3 ; DBF version 3 file reader
#:py-configparser ; Read old-style INI config files
)
:components ((:file "params")
:serial t
:description "Load data into PostgreSQL"
:author "Dimitri Fontaine <dimitri@2ndQuadrant.fr>"
:license "The PostgreSQL Licence"
:depends-on (#:uiop ; host system integration
#:cl-log ; logging
#:postmodern ; PostgreSQL protocol implementation
#:cl-postgres ; low level bits for COPY streaming
#:simple-date ; FIXME: recheck dependency
#:cl-mysql ; CFFI binding to libmysqlclient-dev
#:split-sequence ; some parsing is made easy
#:cl-csv ; full CSV reader
#:cl-fad ; file and directories
#:lparallel ; threads, workers, queues
#:esrap ; parser generator
#:alexandria ; utils
#:drakma ; http client, download archives
#:zip ; support for zip archive files
#:flexi-streams ; streams
#:com.informatimago.clext ; portable character-sets listings
#:usocket ; UDP / syslog
#:local-time ; UDP date parsing
#:command-line-arguments ; for the main function
#:abnf ; ABNF parser generator (for syslog)
#:db3 ; DBF version 3 file reader
#:py-configparser ; Read old-style INI config files
)
:components
((:module "src"
:components
((:file "params")
(:file "package" :depends-on ("params"))
(:file "utils" :depends-on ("package"))
@ -70,6 +73,6 @@
"db3"
"archive"
"syslog"
"mysql"))))
"mysql"))))))

View File

@ -42,6 +42,7 @@
(:seconds 12 14))))
"Apply this function when input date in like '20041002152952'"
;; only process non-zero dates
(declare (type string date-string))
(if (null (zero-dates-to-null date-string)) nil
(destructuring-bind (&key year month day hour minute seconds
&allow-other-keys)