Package: palje
PaljeDescriptionPalje is a tool for creating hierarchical documentation of SQL Server databases to Confluence wiki.DependenciespyodbcrequestsInstall GuidePyPIInstall fromPython Package Indexwith the following command:pip install paljeClone and installClone this repositoryInstall with pipcd .\palje
pip install [-e] .UsagePrerequisitesRead access to the MSSQL database you wish to documentData is read from documented database, information schema and system viewsYou can use either SQL authentication or Windows authentication (if available)Write access to Confluence space on which you wish to create the documentation pagesAtlassian API Token for your accountPalje uses your registered account email and API token to authenticate to Confluence CloudGo tohttps://id.atlassian.com/manage/api-tokensChoose "Create API token"Give it a nameToken password will be created automatically, save this passwordRemarks on compatibilityPalje has been tested on multiple SQL Server versions, includingSQL Server imagesPalje has been tested on cloud instances, such as Azure SQL DatabaseWe are not (yet) executing regular testing on such instancesPalje has been tested to work with Confluence CloudThere is a possibility that Palje works with Confluence Server since the Server REST API is similar to Cloud REST APINotice that the authentication works differently in Confluence ServerCLI and argumentspython -m palje confluence-url space server database
                --parent-page PARENT_PAGE
                --schemas SCHEMAS [SCHEMAS ...]
                --dependent DEPENDENT [DEPENDENT ...]
                --db-driver DB_DRIVERArgumentRequiredDescriptionTypeDefault Valueconfluence-urlYesURL to Confluence REST content. In Confluence Cloud, this is something likehttps://yourconfluence.atlassian.net/wiki/rest/api/contentstrspaceYesSpace key of the Confluence space, in which the documentation is createdstrserverYesHost name of the SQL Server. Include port with commastrdatabaseYesName of the database that is documentedstrparent-pageNoName or title of the Confluence page, under which the documentation is createdstrIf page is not given, the documentation will be created to top level (under pages)schemasNoNames of the schemas that are documentedlist of strIf schemas not given, all schemas will be documenteddependentNoNames of the databases, where object dependencies are soughtlist of strIf databases not given, dependencies are sought only in documented databasedb-driverNoName of the database driverstr"ODBC Driver 17 for SQL Server"Usage exampleCommandcd .\palje
python -m palje "https://yourconfluence.atlassian.net/wiki/rest/api/content" TEST "localhost,1433" MY_DB --schemas dbo store --dependent MY_OTHER_DBOutputUser for localhost,1433.MY_DB. If you wish to use Windows Authentication, hit enter: sa
Password for user sa:
Confluence user for yourconfluence.atlassian.net: example.user@youremail.com
Password for user example.user@youremail.com:
--------------------------
Object dependencies are queried from the following databases: MY_DB, MY_OTHER_DB
--------------------------
Page DATABASE: MY_DB created.
Page MY_DB.dbo created.
Page Tables MY_DB.dbo created.
Page MY_DB.dbo.schema_version created.
Page MY_DB.store created.
Page Tables MY_DB.store created.
Page MY_DB.store.Clients created.
Page MY_DB.store.Products created.
Page Procedures MY_DB.store created.
Page MY_DB.store.spSELECT created.ResultPage hierarchy in ConfluencePage showing the database objectsPage showing the table informationRe-runRe-running the command will result updating the existing pagesPage DATABASE: MY_DB updated.
Page MY_DB.dbo updated.
Page Tables MY_DB.dbo updated.
Page MY_DB.dbo.schema_version updated.
Page MY_DB.store updated.
Page Tables MY_DB.store updated.
Page MY_DB.store.Clients updated.
Page MY_DB.store.Products updated.
Page Procedures MY_DB.store updated.
Page MY_DB.store.spSELECT updated.If new objects have been created to database before re-run, new pages will be created for these objects. For example, if new procedurestore.spNEW_SELECTis created to database, a new pageMY_DB.store.spNEW_SELECTis created under pageProcedures MY_DB.store.Notice that if you delete objects from database, Palje won't delete the corresponding pages from Confluence. You must manually delete the pages from wiki.TestsRun tests withtoxpip install tox

tox -- --mssql_host MSSQL_HOST --mssql_port MSSQL_PORT --mssql_username MSSQL_USER --mssql_password MSSQL_PASSWORD --mssql_driver MSSQL_DRIVER

# without MSSQL tests
toxorpytestpip install pytest ahjo sqlalchemy

pytest --mssql_host MSSQL_HOST --mssql_port MSSQL_PORT --mssql_username MSSQL_USER --mssql_password MSSQL_PASSWORD --mssql_driver MSSQL_DRIVER

# without MSSQL tests
pytestNotice that tests have dependencies to packagesahjoandSQL Alchemy. To succesfully run SQL Server tests, you must have permissions to create a new database in instance.LicenseCopyright 2021 ALM Partners OyLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.