Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonathas/fileloader
A file loader written in Perl that reads a tsv file and loads its content into a MySQL database
https://github.com/jonathas/fileloader
fileloader mysql perl
Last synced: about 1 month ago
JSON representation
A file loader written in Perl that reads a tsv file and loads its content into a MySQL database
- Host: GitHub
- URL: https://github.com/jonathas/fileloader
- Owner: jonathas
- License: gpl-2.0
- Created: 2016-02-14T22:49:17.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-15T07:48:06.000Z (almost 9 years ago)
- Last Synced: 2023-03-12T08:42:31.859Z (almost 2 years ago)
- Topics: fileloader, mysql, perl
- Language: Perl
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FileLoader
A "loader" that is executed with parameters: path, file_mask
Then connects to the DB (MySQL), looks to given path, reads a tab separated text file, loads file content to DB and moves file to {path}/executed
Rules:
- If there already exists record in DB with given ID, that record is updated with information from file and update_timestamp is set to system current timestamp.
- If new record is detected in file, new record is created in DB with attributes from file and Update_timestamp is set to system current timestamp.
- If any update is detected, record in DB is updated and Update_timestamp is set to system current timestamp.
- If record does not exist in the file, no action is taken.Files shall contain 3 columns:
```
ID (varchar 32)
Name (varchar 255)
Date (date)
```Database stores in one table:
```
ID (varchar 32)
Name (varchar 255)
Date (date)
Update_timestamp (timestamp)
```Usage:
```
fileloader.pl path file_mask
```Example:
```
fileloader.pl /var/loader_files headers.tsv
```----
TODO:
- Improve error handling
- Implement Unit Tests