]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blob - htsn-import.cabal
Replace all raw DELETE queries with deleteAll.
[dead/htsn-import.git] / htsn-import.cabal
1 name: htsn-import
2 version: 0.0.4
3 cabal-version: >= 1.8
4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 category: Utils
7 license: GPL-3
8 license-file: doc/LICENSE
9 build-type: Simple
10 extra-source-files:
11 doc/dbschema/*.png
12 doc/htsn-importrc.example
13 doc/man1/htsn-import.1
14 doc/README.dbschema
15 doc/README.schemagen
16 doc/TODO
17 makefile
18 schema/*.dtd
19 schemagen/Auto_Racing_Schedule_XML/*.xml
20 schemagen/Heartbeat/*.xml
21 schemagen/injuriesxml/*.xml
22 schemagen/Injuries_Detail_XML/*.xml
23 schemagen/newsxml/*.xml
24 schemagen/Odds_XML/*.xml
25 schemagen/scoresxml/*.xml
26 schemagen/weatherxml/*.xml
27 test/shell/*.test
28 test/xml/*.xml
29 test/xml/*.dtd
30 synopsis:
31 Import XML files from The Sports Network into an RDBMS.
32 description:
33 /Usage/:
34 .
35 @
36 htsn-import [OPTIONS] [FILES]
37 @
38 .
39 The Sports Network <http://www.sportsnetwork.com/> offers an XML feed
40 containing various sports news and statistics. Our sister program
41 /htsn/ is capable of retrieving the feed and saving the individual
42 XML documents contained therein. But what to do with them?
43 .
44 The purpose of /htsn-import/ is to take these XML documents and
45 get them into something we can use, a relational database management
46 system (RDBMS), loosely known as a SQL database. The structure of
47 relational database, is, well, relational, and the feed XML is not. So
48 there is some work to do before the data can be inserted.
49 .
50 First, we must parse the XML. Each supported document type (see below)
51 has a full pickle/unpickle implementation (\"pickle\" is simply a
52 synonym for serialize here). That means that we parse the entire
53 document into a data structure, and if we pickle (serialize) that data
54 structure, we get the exact same XML document tha we started with.
55 .
56 This is important for two reasons. First, it serves as a second level
57 of validation. The first validation is performed by the XML parser,
58 but if that succeeds and unpicking fails, we know that something is
59 fishy. Second, we don't ever want to be surprised by some new element
60 or attribute showing up in the XML. The fact that we can unpickle the
61 whole thing now means that we won't be surprised in the future.
62 .
63 The aforementioned feature is especially important because we
64 automatically migrate the database schema every time we import a
65 document. If you attempt to import a \"newsxml.dtd\" document, all
66 database objects relating to the news will be created if they do not
67 exist. We don't want the schema to change out from under us without
68 warning, so it's important that no XML be parsed that would result in
69 a different schema than we had previously. Since we can
70 pickle/unpickle everything already, this should be impossible.
71 .
72 Examples and usage documentation are available in the man page.
73
74 executable htsn-import
75 build-depends:
76 base == 4.*,
77 cmdargs >= 0.10.6,
78 configurator == 0.2.*,
79 directory == 1.2.*,
80 filepath == 1.3.*,
81 hslogger == 1.2.*,
82 htsn-common == 0.0.1,
83 hxt == 9.3.*,
84 -- deleteAll showed up in 0.4.1
85 groundhog >= 0.4.1,
86 groundhog-postgresql == 0.4.*,
87 groundhog-sqlite == 0.4.*,
88 groundhog-th == 0.4.*,
89 MissingH == 1.2.*,
90 old-locale == 1.0.*,
91 tasty == 0.8.*,
92 tasty-hunit == 0.8.*,
93 time == 1.4.*,
94 transformers == 0.3.*,
95 tuple == 0.2.*
96
97 main-is:
98 Main.hs
99
100 hs-source-dirs:
101 src/
102
103 other-modules:
104 Backend
105 CommandLine
106 Configuration
107 ConnectionString
108 ExitCodes
109 OptionalConfiguration
110 TSN.Codegen
111 TSN.Database
112 TSN.DbImport
113 TSN.Picklers
114 TSN.XmlImport
115 TSN.XML.AutoRacingSchedule
116 TSN.XML.Heartbeat
117 TSN.XML.Injuries
118 TSN.XML.InjuriesDetail
119 TSN.XML.News
120 TSN.XML.Odds
121 TSN.XML.Scores
122 TSN.XML.Weather
123 Xml
124
125 ghc-options:
126 -Wall
127 -fwarn-hi-shadowing
128 -fwarn-missing-signatures
129 -fwarn-name-shadowing
130 -fwarn-orphans
131 -fwarn-type-defaults
132 -fwarn-tabs
133 -fwarn-incomplete-record-updates
134 -fwarn-monomorphism-restriction
135 -fwarn-unused-do-bind
136 -O2
137
138 ghc-prof-options:
139 -prof
140 -fprof-auto
141 -fprof-cafs
142 -- The following unbreak profiling with template haskell. We have
143 -- to build the program twice; once without profile and again with
144 -- these flags.
145 -hisuf hi_p
146 -osuf o_p
147
148
149 test-suite testsuite
150 type: exitcode-stdio-1.0
151 hs-source-dirs: src test
152 main-is: TestSuite.hs
153 build-depends:
154 base == 4.*,
155 cmdargs >= 0.10.6,
156 configurator == 0.2.*,
157 directory == 1.2.*,
158 filepath == 1.3.*,
159 hslogger == 1.2.*,
160 htsn-common == 0.0.1,
161 hxt == 9.3.*,
162 groundhog == 0.4.*,
163 groundhog-postgresql == 0.4.*,
164 groundhog-sqlite == 0.4.*,
165 groundhog-th == 0.4.*,
166 MissingH == 1.2.*,
167 old-locale == 1.0.*,
168 tasty == 0.8.*,
169 tasty-hunit == 0.8.*,
170 time == 1.4.*,
171 transformers == 0.3.*,
172 tuple == 0.2.*
173
174 -- It's not entirely clear to me why I have to reproduce all of this.
175 ghc-options:
176 -Wall
177 -fwarn-hi-shadowing
178 -fwarn-missing-signatures
179 -fwarn-name-shadowing
180 -fwarn-orphans
181 -fwarn-type-defaults
182 -fwarn-tabs
183 -fwarn-incomplete-record-updates
184 -fwarn-monomorphism-restriction
185 -fwarn-unused-do-bind
186 -O2
187
188
189 test-suite doctests
190 type: exitcode-stdio-1.0
191 hs-source-dirs: test
192 main-is: Doctests.hs
193 build-depends:
194 base == 4.*,
195 -- Additional test dependencies.
196 doctest == 0.9.*
197
198 -- It's not entirely clear to me why I have to reproduce all of this.
199 ghc-options:
200 -Wall
201 -fwarn-hi-shadowing
202 -fwarn-missing-signatures
203 -fwarn-name-shadowing
204 -fwarn-orphans
205 -fwarn-type-defaults
206 -fwarn-tabs
207 -fwarn-incomplete-record-updates
208 -fwarn-monomorphism-restriction
209 -fwarn-unused-do-bind
210 -rtsopts
211 -threaded
212 -optc-O3
213 -optc-march=native
214 -O2
215
216
217 -- These won't work without shelltestrunner installed in your
218 -- $PATH. Maybe there is some way to tell Cabal that.
219 test-suite shelltests
220 type: exitcode-stdio-1.0
221 hs-source-dirs: test
222 main-is: ShellTests.hs
223
224 build-depends:
225 base == 4.*,
226 cmdargs >= 0.10.6,
227 configurator == 0.2.*,
228 directory == 1.2.*,
229 filepath == 1.3.*,
230 hslogger == 1.2.*,
231 htsn-common == 0.0.1,
232 hxt == 9.3.*,
233 groundhog == 0.4.*,
234 groundhog-postgresql == 0.4.*,
235 groundhog-sqlite == 0.4.*,
236 groundhog-th == 0.4.*,
237 MissingH == 1.2.*,
238 old-locale == 1.0.*,
239 process == 1.1.*,
240 tasty == 0.8.*,
241 tasty-hunit == 0.8.*,
242 time == 1.4.*,
243 transformers == 0.3.*,
244 tuple == 0.2.*
245
246
247
248 source-repository head
249 type: git
250 location: http://michael.orlitzky.com/git/htsn-import.git
251 branch: master