bugfix
This commit is contained in:
parent
c8318a276c
commit
8963ba2f9c
44
dataloader/README.md
Normal file
44
dataloader/README.md
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
# dataloader
|
||||||
|
a tool to load data into database from excel file
|
||||||
|
|
||||||
|
## Dependents
|
||||||
|
* [Gadget](https://github.com/yumoqing/gadget)
|
||||||
|
|
||||||
|
You should have a gadget run environment installed before, the dataloader
|
||||||
|
uses gadget conf/config.json file to read the database configuation.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
change the current folder to gadget running folder(it contains a "conf" folder which config.json file in it), then
|
||||||
|
```
|
||||||
|
datalaoder excel_data_file
|
||||||
|
```
|
||||||
|
|
||||||
|
## Excel file format
|
||||||
|
|
||||||
|
### Specifies the target database
|
||||||
|
use a datasheet to set the sheet name preffix and subffix with '__', examples:
|
||||||
|
"__testdb__" stand for "testdb", "__mydatabase__" stand for "mydatabase",
|
||||||
|
|
||||||
|
### Specifies the target table
|
||||||
|
the table name will use to insert data can be specifies by set the sheet name as the table name
|
||||||
|
|
||||||
|
### Specifies the field name
|
||||||
|
dataloader can inserts data to a table not necesary provide all the fields data, the table's nullable fields can be ignore.
|
||||||
|
|
||||||
|
first row in the sheet is use to specify the fields with data, each cell for one field, value of the cell should be fill in the table's field name.
|
||||||
|
|
||||||
|
### Specifies the data
|
||||||
|
Data start from second row in the sheet, each row for one records
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
there is a kboss database in databases, and the kboss database have two tabel named by 'appcodes' and 'appcodes_kv'
|
||||||
|
|
||||||
|
* Specify database
|
||||||
|
![specify database](./database.png)
|
||||||
|
|
||||||
|
* Specify table appcodes
|
||||||
|
![specify appcodes table](./table1.png)
|
||||||
|
|
||||||
|
* Specify table appcodes_kv
|
||||||
|
![specify table appcodes_kv](./table1.png)
|
||||||
|
|
BIN
dataloader/database.png
Normal file
BIN
dataloader/database.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 233 KiB |
BIN
dataloader/table1.png
Normal file
BIN
dataloader/table1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 181 KiB |
BIN
dataloader/table2.png
Normal file
BIN
dataloader/table2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 200 KiB |
4
dataloader/ubuntu/build.sh
Executable file
4
dataloader/ubuntu/build.sh
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
pyinstaller -y --clean dataloader.spec
|
||||||
|
echo "build success, please find the target in dist folder"
|
47
dataloader/ubuntu/dataloader.spec
Normal file
47
dataloader/ubuntu/dataloader.spec
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
|
block_cipher = None
|
||||||
|
|
||||||
|
|
||||||
|
a = Analysis(
|
||||||
|
['../dataloader.py'],
|
||||||
|
pathex=[],
|
||||||
|
binaries=[],
|
||||||
|
datas=[],
|
||||||
|
hiddenimports=[
|
||||||
|
"aiopg",
|
||||||
|
"aiomysql"
|
||||||
|
],
|
||||||
|
hookspath=[],
|
||||||
|
hooksconfig={},
|
||||||
|
runtime_hooks=[],
|
||||||
|
excludes=[],
|
||||||
|
win_no_prefer_redirects=False,
|
||||||
|
win_private_assemblies=False,
|
||||||
|
cipher=block_cipher,
|
||||||
|
noarchive=False,
|
||||||
|
)
|
||||||
|
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
||||||
|
|
||||||
|
exe = EXE(
|
||||||
|
pyz,
|
||||||
|
a.scripts,
|
||||||
|
a.binaries,
|
||||||
|
a.zipfiles,
|
||||||
|
a.datas,
|
||||||
|
[],
|
||||||
|
name='dataloader',
|
||||||
|
debug=False,
|
||||||
|
bootloader_ignore_signals=False,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
upx_exclude=[],
|
||||||
|
runtime_tmpdir=None,
|
||||||
|
console=True,
|
||||||
|
disable_windowed_traceback=False,
|
||||||
|
argv_emulation=False,
|
||||||
|
target_arch=None,
|
||||||
|
codesign_identity=None,
|
||||||
|
entitlements_file=None,
|
||||||
|
)
|
2
dataloader/windows/build.bat
Executable file
2
dataloader/windows/build.bat
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
pyinstaller -y --clean dataloader.spec
|
||||||
|
echo "build success, please find the target in dist folder"
|
47
dataloader/windows/dataloader.spec
Normal file
47
dataloader/windows/dataloader.spec
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
|
block_cipher = None
|
||||||
|
|
||||||
|
|
||||||
|
a = Analysis(
|
||||||
|
['../dataloader.py'],
|
||||||
|
pathex=[],
|
||||||
|
binaries=[],
|
||||||
|
datas=[],
|
||||||
|
hiddenimports=[
|
||||||
|
"aiopg",
|
||||||
|
"aiomysql"
|
||||||
|
],
|
||||||
|
hookspath=[],
|
||||||
|
hooksconfig={},
|
||||||
|
runtime_hooks=[],
|
||||||
|
excludes=[],
|
||||||
|
win_no_prefer_redirects=False,
|
||||||
|
win_private_assemblies=False,
|
||||||
|
cipher=block_cipher,
|
||||||
|
noarchive=False,
|
||||||
|
)
|
||||||
|
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
||||||
|
|
||||||
|
exe = EXE(
|
||||||
|
pyz,
|
||||||
|
a.scripts,
|
||||||
|
a.binaries,
|
||||||
|
a.zipfiles,
|
||||||
|
a.datas,
|
||||||
|
[],
|
||||||
|
name='dataloader',
|
||||||
|
debug=False,
|
||||||
|
bootloader_ignore_signals=False,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
upx_exclude=[],
|
||||||
|
runtime_tmpdir=None,
|
||||||
|
console=True,
|
||||||
|
disable_windowed_traceback=False,
|
||||||
|
argv_emulation=False,
|
||||||
|
target_arch=None,
|
||||||
|
codesign_identity=None,
|
||||||
|
entitlements_file=None,
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user