question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consolidate data-source section

See original GitHub issue

Summary

Consolidate custom database configuration options into the data-source object

Motivation

Group configuration options related to database connections into just one object to make it easier to identify and manage.

Functional Specifications

While not officially documented yet, the JSON schema provides support for a custom, database-specific section in the configuration file. For example, for Cosmos DB:

{
  "data-source": {
    "database-type": "cosmos",
    "connection-string": "AccountEndpoint=https://localhost:8081/;AccountKey=REPLACEME;"
  },
  "cosmos": {
    "database": "PlaygroundDB",
    "schema": "schema.gql"
  }
}

The proposal is to move everything inside data-source. I think there can be two options to do this

Option 1

The section is just moved into the data-source object, and renamed to a more friendly name, like "cosmos-options.

{
  "$schema": "dab.draft-01.schema.json",
  "data-source": {
    "database-type": "cosmos",
    "cosmos-options": {
      "database": "PlaygroundDB",
      "schema": "schema.gql"
    },
    "connection-string": "AccountEndpoint=https://localhost:8081/;AccountKey=REPLACEME;"
  }
}

Every database will be able to have their own options section, for example mssql-options or postgresql-options

Option 2

The database type value is turned into a full object:

{
  "$schema": "dab.draft-01.schema.json",
  "data-source": {    
    "cosmos": {
      "database": "PlaygroundDB",
      "schema": "schema.gql",
      "connection-string": "AccountEndpoint=https://localhost:8081/;AccountKey=REPLACEME;"
    }    
  }
}

Every database will be able to have their own section, for example mssql or postgresql

The second option seems better to me as more concise and with no data duplication and clearly defines the target database used along its options / configuration

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
yorekcommented, Nov 7, 2022

Ok, let’s go with option 1, then (eg:

{
  "$schema": "dab.draft-01.schema.json",
  "data-source": {
    "database-type": "",
    "options": {
      "..."
    },
    "connection-string": "AccountEndpoint=https://localhost:8081/;AccountKey=REPLACEME;"
  }
}
2reactions
sajeetharancommented, Nov 15, 2022

Hi @ayush3797 Since Cosmos DB has different underlying APIs hyphen is used to differentiate the underlying API. Yeah regarding having enums with C#, what if we change it to _

cosmosdb_apitype all in lowercase. - cosmosdb_nosql

Also regarding cosmosdb_postgresql yeah we can reuse the same implementation which we implemented for the native postgresql as @GaryHopeMS mentioned that existing implementation should work with the cosmosdb_postgresql connection string.

@mbhaskar kindly add your inputs as well

Read more comments on GitHub >

github_iconTop Results From Across the Web

Consolidating data from source systems | The Analytics ...
If you have data from many source systems, it is important to consolidate them to a central place. In this section, we talk...
Read more >
Consolidate data in multiple worksheets
To summarize and report results from separate worksheets, you can consolidate data from each separate worksheet into a master worksheet.
Read more >
Combine + Diffable Data Source
Combine and diffable data sources are two powerful yet ... The Section parameter is an enum that has default Hashable conformance.
Read more >
Consolidate Layer (Data Management) - ArcGIS Pro Resources
ArcGIS geoprocessing tool that consolidates one or more layers and all referenced data sources into a single folder.
Read more >
What is data consolidation and how do you implement it?
Data consolidation is the process of consolidating data from multiple sources into a single destination. During the consolidation of data ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found