Skip to content

Commit fcf1c82

Browse files
Update README.md
1 parent fb053e6 commit fcf1c82

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,13 @@ To use the application, first build with `make`, then execute the application pr
1313

1414
`make`
1515
`./bin/csv-2-postgresql test2.csv postgres://postgres:hello@localhost/test?sslmode=disable`
16+
17+
# Design
18+
19+
* main package (csv-2-postgresql) defines both the entry point to the application and the main interfaces (Parser and DatabaseWriter).
20+
* These interfaces have implementations using 3rd party packages for handling the CSV and Postgresql part of their operation.
21+
* This helps relieve the dependencies that must be brought into the main program, decreasing coupling.
22+
* The schema package defines the domain model (which is simply the schema of the CSV file for this problem space).
23+
* Both the CSV parser and Postgresql DB adapter use private helper methods to determine the types best suited for the data and convert to types compatible with the database.
24+
* Unit tests cover all the business logic in the CSV parser and Postgresql database adapter.
25+
* I neglected to use vendoring for this project to keep things simple, the latest versions of build and test dependencies are installed using the Makefile automatically when building or testing.

0 commit comments

Comments
 (0)