slingdata-io / sling-cli

Sling is a CLI tool that extracts data from a source storage/database and loads it in a target storage/database.
https://docs.slingdata.io
GNU General Public License v3.0
436 stars 34 forks source link

MSSQL/JSON column casing not respected #412

Closed OneCyrus closed 2 weeks ago

OneCyrus commented 3 weeks ago

Issue Description

export MSSQL='sqlserver://{{ mssql_login_user }}:{{ mssql_login_password }}@{{ mssql_host }}:{{ mssql_port }}?database={{ mssql_database }}'
      sling run --src-conn MSSQL \
                --src-stream '{{ mssql_statement }}' \
                --tgt-object 'file://{{ playbook_dir }}/{{ json_result_file }}' } \
                --tgt-options '{"column_casing": "source"}' \
                -d
2024-10-21 07:51:19 DBG Sling version: 1.2.20 (linux amd64)
2024-10-21 07:51:19 DBG type is db-file
2024-10-21 07:51:19 DBG using: {"columns":null,"mode":"full-refresh","transforms":null}
2024-10-21 07:51:19 DBG using source options: {"empty_as_null":false,"null_if":"NULL","datetime_format":"AUTO","max_decimals":-1}
2024-10-21 07:51:19 DBG using target options: {"header":true,"compression":"auto","concurrency":7,"datetime_format":"auto","delimiter":",","file_max_rows":0,"file_max_bytes":0,"max_decimals":-1,"use_bulk":true,"add_new_columns":true,"adjust_column_type":false,"column_casing":"source"}
2024-10-21 07:51:19 DBG opened "sqlserver" connection (conn-sqlserver-rgt)
2024-10-21 07:51:19 INF connecting to source database (sqlserver)
2024-10-21 07:51:19 INF reading from source database
2024-10-21 07:51:19 DBG select * from [dbo].[MTV_Microsoft$SQLServer$AnalysisServices$Windows$TabularInstance]
2024-10-21 07:51:19 INF writing to target file system (file)
2024-10-21 07:51:19 DBG opened "file" connection (conn-file-Rkg)
2024-10-21 07:51:19 DBG writing to file:///runner/project/datacollection/sources/scom/ssas_TabularInstance.json [fileRowLimit=0 fileBytesLimit=0 compression=auto concurrency=7 useBufferedStream=false fileFormat=json singleFile=true]
2024-10-21 07:51:19 DBG wrote 1.7 kB: 1 rows [16 r/s]
2024-10-21 07:51:19 INF wrote 1 rows [16 r/s] to file:///runner/project/datacollection/sources/scom/ssas_TabularInstance.json
2024-10-21 07:51:19 DBG closed "sqlserver" connection (conn-sqlserver-rgt)
2024-10-21 07:51:19 INF execution succeeded
flarco commented 2 weeks ago

Done, feel free to test the dev build: https://github.com/slingdata-io/sling-cli?tab=readme-ov-file#automated-dev-builds