Skip to content

Commit 966c966

Browse files
Arpan-GArpan-G
Arpan-G
authored and
Arpan-G
committed
bump version and update readme for release
1 parent e716a8b commit 966c966

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ A description of all the available command line arguments that can be used are g
101101
|\-\-skip-validate-import|Skip validating the imported data|false|None, this is compulsory if the operations specified requires database access|
102102
|\-\-connection-socket|The mysql socket file path|/var/run/mysqld/mysqld.sock|
103103
|\-\-varchar-limit|The value of varchar type, and the limit after which a string is considered a text and not a varchar|100|
104-
|\-\-custom-date-patterns|[Custom patterns](#datetime) to identify arbitrary date formats|None|
105-
|\-\-custom-datetime-patterns|[Custom patterns](#datetime) to identify arbitrary datetime formats| None|
106104
|\-\-schema-infer-chunk-size|The chunk size to use when the schema fora CSV will be inferred parallelly. For example, a chunk size 100 means the CSV will be read 100 rows at a time and separate processes will be used to infer the schema for each 100-row chunk|100|
107105
|\-\-worker-count|The number of workers, directly related to how many CSVs will be processed parallelly|10|
108106
|\-\-db-worker-count|The number of database workers, lowering the value will lead to slow performance but lesser load on database, a higher value can lead to too many database connection errors.|15|
@@ -245,13 +243,14 @@ If a csv file contains date or datetime in some other format then they will be i
245243
patterns we can import such data of arbitrary formats as date or datetime.
246244

247245
csv2sql uses the [Timex](https://github.com/bitwalker/timex) library to parse date/datetime.
248-
In order to specify custom patterns for date or datetime use the `--custom-date-patterns` or `--custom-datetime-patterns` arguments
249-
followed by a string having one or more patterns separated by `;`
246+
You can specify multiple custom patterns for date or datetime as a string having one or more patterns separated by `;`
250247

251248
When using the Web UI for csv2sql enter these pattern strings in the config page under "Custom date patterns" or "Custom datetime patterns".
252249

253250
The patterns should be compatible with Timex directives specified [here](https://hexdocs.pm/timex/Timex.Format.DateTime.Formatters.Default.html#module-list-of-all-directives).
254251

252+
(Custom patterns are only supported when using the web ui and are not available in the cli version of the application)
253+
255254
#### Good to know/Caveats
256255

257256
* Fractional seconds or timezone information is not handled when importing datetime data.
@@ -262,9 +261,9 @@ The patterns should be compatible with Timex directives specified [here](https:/
262261

263262
To parse datetime like `11/14/2021 3:43:28 PM` a pattern like `{0M}/{0D}/{YYYY} {h12}:{m}:{s} {AM}` can be specified
264263

265-
The complete command might look like...
264+
The custom pattern needed is like...
266265

267-
`./csv2sql --source-csv-directory "/home/user/Desktop/csvs" --db-connection-string "mysql:root:pass@localhost/test_csv" --custom-datetime-patterns "{0M}/{0D}/{YYYY} {h12}:{m}:{s} {AM}"`
266+
`{0M}/{0D}/{YYYY} {h12}:{m}:{s} {AM}`
268267

269268
Consider a CSV with date or datetime having multiple formats like...
270269

@@ -276,8 +275,11 @@ Consider a CSV with date or datetime having multiple formats like...
276275

277276
The pattern strings to parse the above csv would look like...
278277

279-
`--custom-date-patterns {YYYY}-{0M}-{0D};{0M}-{0D}-{YYYY}`
280-
`--custom-datetime-patterns {YYYY}-{0M}-{0D}T{0h24}:{m}:{s};{0M}-{0D}-{YYYY} {0h24}:{m}:{s};{0M}/{0D}/{YYYY} {h12}:{m}:{s} {AM}`
278+
For date
279+
`{YYYY}-{0M}-{0D};{0M}-{0D}-{YYYY}`
280+
281+
For datetime
282+
`{YYYY}-{0M}-{0D}T{0h24}:{m}:{s};{0M}-{0D}-{YYYY} {0h24}:{m}:{s};{0M}/{0D}/{YYYY} {h12}:{m}:{s} {AM}`
281283

282284

283285
<a name="issues"></a>

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule Csv2sql.Umbrella.MixProject do
44
def project do
55
[
66
apps_path: "apps",
7-
version: "2.0.1",
7+
version: "3.0.0",
88
build_embedded: Mix.env() == :prod,
99
start_permanent: Mix.env() == :prod,
1010
deps: deps(),

0 commit comments

Comments
 (0)