Skip to content

Commit 7bfcddc

Browse files
author
Thomas Mahlberg
committed
Updated MD files and moved TableGroups
1 parent a2c5c48 commit 7bfcddc

File tree

3 files changed

+92
-10
lines changed

3 files changed

+92
-10
lines changed

KustoSchemaTools/Model/TableGroup.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

README.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,62 @@
11
# KustoSchemaTools
2-
This repository contains C# code to synchronize database schemas from Azure Data Explorer (Kusto) to yaml files and back.
2+
3+
This C# project provides functionality to work with schemas in Azure Data Explorer (Kusto). You can load a schema from yaml files or a database to the interal data structure. This can be used for creating diffs of two databases as scripts or markdown, and also to write it back to files or update schemas in a database.
4+
5+
A second project "[KustoSchemaToolsAction](https://github.com/github/KustoSchemaToolsAction)" wraps that into CLI tool inside a docker container for usage in GitHub Actions.
6+
7+
## Getting started
8+
9+
The `database` object holds all schema related information for a Kusto database. It can be loaded from, or written to a cluster using the `KustoDatabaseHandler` which can be created by the `KustoDatabaseHandlerFactory`.There are several steps involved for loading a all relevant information from a kusto database into the `database` object. These are covered by different plugins, which can be configured for the `KustoDatabaseHandlerFactory`.
10+
11+
```csharp
12+
var dbFactory = new KustoDatabaseHandlerFactory(sp.GetService<ILogger<KustoDatabaseHandler>>())
13+
.WithPlugin<KustoDatabasePrincipalLoader>()
14+
.WithPlugin<KustoDatabaseRetentionAndCacheLoader>()
15+
.WithPlugin<KustoTableBulkLoader>()
16+
.WithPlugin<KustoFunctionBulkLoader>()
17+
.WithPlugin<KustoMaterializedViewBulkLoader>()
18+
.WithPlugin<DatabaseCleanup>()
19+
```
20+
21+
22+
For syncrhonizing it to files, the `YamlDatabaseHandler` and the `YamlDatabaseHandlerFactory` are the right tools. To prevent super large files, there are plugins that handle reading and writing functions, tables and materialized views to separate files and folders. They can be configured for the `YamlDatabaseHandlerFactory`.
23+
24+
```csharp
25+
var yamlFactory = new YamlDatabaseHandlerFactory()
26+
.WithPlugin(new TablePlugin())
27+
.WithPlugin(new FunctionPlugin())
28+
.WithPlugin(new MaterializedViewsPlugin())
29+
.WithPlugin<DatabaseCleanup>();
30+
```
31+
32+
Additional features can be added with custom plugins. A sample for `table groups`, where the some parts of the schema are defined once, but is applied for several tables can be found in [here](https://github.com/github/KustoSchemaToolsAction/blob/main/KustoSchemaCLI/Plugins/TableGroupPlugin.cs).
33+
34+
The `KustoSchemaHandler` is the central place for synching schemas between yaml and a database. It offers functions for generating changes formatted in markdown, writing a database to yaml files and applying changes from yaml files to a database.
35+
36+
## Supported Features
37+
38+
Currently following features are supported:
39+
40+
* Database
41+
* Permissions
42+
* Default Retention
43+
* Default Hot Cache
44+
* Tables
45+
* Columns
46+
* Retention
47+
* HotCache
48+
* Update Policies
49+
* Docstring
50+
* Folder
51+
* Functions
52+
* Body
53+
* Docstring
54+
* Folder
55+
* Materialized Views
56+
* Query
57+
* Retention
58+
* HotCache
59+
* Docstring
60+
* Folder
61+
62+
The `DatabaseCleanup` will remove redundant retention and hotcache definitions. It will also pretty print KQL queries in functions, update policies and materialized views.

SECURITY.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Thanks for helping make GitHub safe for everyone.
2+
3+
# Security
4+
5+
GitHub takes the security of our software products and services seriously, including all of the open source code repositories managed through our GitHub organizations, such as [GitHub](https://github.com/GitHub).
6+
7+
Even though [open source repositories are outside of the scope of our bug bounty program](https://bounty.github.com/index.html#scope) and therefore not eligible for bounty rewards, we will ensure that your finding gets passed along to the appropriate maintainers for remediation.
8+
9+
## Reporting Security Issues
10+
11+
If you believe you have found a security vulnerability in any GitHub-owned repository, please report it to us through coordinated disclosure.
12+
13+
**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.**
14+
15+
Instead, please send an email to opensource-security[@]github.com.
16+
17+
Please include as much of the information listed below as you can to help us better understand and resolve the issue:
18+
19+
* The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
20+
* Full paths of source file(s) related to the manifestation of the issue
21+
* The location of the affected source code (tag/branch/commit or direct URL)
22+
* Any special configuration required to reproduce the issue
23+
* Step-by-step instructions to reproduce the issue
24+
* Proof-of-concept or exploit code (if possible)
25+
* Impact of the issue, including how an attacker might exploit the issue
26+
27+
This information will help us triage your report more quickly.
28+
29+
## Policy
30+
31+
See [GitHub's Safe Harbor Policy](https://docs.github.com/en/github/site-policy/github-bug-bounty-program-legal-safe-harbor#1-safe-harbor-terms)

0 commit comments

Comments
 (0)