Coder Social home page Coder Social logo

karlhochfilzer / cldrtodatabases Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 51 KB

Insert CLDR data to a set of different databases

License: MIT License

C# 93.71% PLpgSQL 3.08% Batchfile 3.21%
ms-sqlserver mysql postgresql sqlite mongodb cldr-data csharp bulk-loader csv-import sql-script

cldrtodatabases's Introduction

CldrToDatabases

Windows Console Application.

I was searching for localized countries data including some additional information to be used in a different set of my projects.
Found a solution where to get a lot of this data at https://github.com/mj1856/TimeZoneNames.
This project is very cool but for my needs it has only localized time zone names and doesn't store the data in a database.

Data is downloaded from http://unicode.org and http://nodatime.org.
All the data marked as 'deprecated' or 'private_use' is not inserted.
I use Languages, Scripts, Territories (incl. Subdivisions), Currencies, TimeZones, MetaZones, WindowsZones and all available translations.
My projects do not need any data that does not exist anymore or that is not in use anymore (is marked as 'deprecated').
All the data is inserted into a set of different databases each using big data import options.

Databases

  • MS SQLServer
    • Version: Microsoft SQL Server Express (64-bit), 13.0.4202.2 (= 2016 Express)
  • MySQL
    • Version: 5.7.9-log MySQL Community Server(GPL), Win64 (x86_64)
  • PostgreSql
    • Version: PostgreSQL 9.6.2 on x86_64-pc-mingw64, compiled by gcc.exe (Rev5, Built by MSYS2 project) 4.9.2, 64-bit
  • SQLite
    • Version: SQLite version 3.7.3
  • Oracle
    • Version: Oracle Database Express Edition 11g Release 2 for Windows x64
  • MongoDB
    • Version: 3.0.7

Usage

1st you have to change the 'connectionStrings' in 'App.config' to your needs.

Read additional information for each Database in it's own class (folder 'DBWriters') start at functions 'CreateDB' or 'SaveDBData'.

Change variables and params on call of DataExtractor.Load(...) and DataToDBs.SaveDataToDBs(...) in 'Program.cs':

Used data will be downloaded on first start and can be forced by setting param 'downloadData' to true.  
If there is no data, it will be downloaded always.  
If you want to store the downloaded data in a different folder, change variable 'projectPath' and 'dataPath' to your needs.  
The complete folder structure will be created if it doesn't exist.  
(You need create, modify and delete authorisation on folders and files!!)  
If your database still exists, change param 'createDatabase' to false. (Database name has to be set in 'connectionStrings'!)  
Note! If you run the program again without creating the database, be shure to empty the tables yourself before!  
After all data is inserted it will be tested as count rows inserted to count rows should be inserted.  
If count rows is not equal, a complete compare of inserted rows to rows that should be inserted will be done.  
Change 'forceFullCompare' to true, if you always want to compare the rows.  

Change the database (connectionStrings - name) to be filled in param 'DBType' and then run the application.

Attention:
The Database (Schema) will be destroyed before and then created as new!!
If your database and tables still exist or you have already created them you must change the param 'createDatabase' to false!!
Or remove the create database part from the '*_Create_DB.sql' file in folder 'DBScripts'.
The scripts to create the database, tables and constraints are splitted because of speed up the inserts.
All passwords in 'App.config'' are set as 'P_PPP_P'.
I read it from file 'pwd.txt' in 'DataBuilder' folder.
This file is NOT included in project! You have to create your own file containing only your password or change the function DataDB.GetPassword() to your needs.
Do NOT use 'Password' like this in production! This is NOT save! You should store your 'Password' AND 'Username' better elsewhere and as encrypted.

cldrtodatabases's People

Contributors

karlhochfilzer avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.