Skip to content

Commit

Permalink
docs: debug instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
koltyakov committed Oct 31, 2023
1 parent 52fd26f commit b366868
Show file tree
Hide file tree
Showing 2 changed files with 131 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Debug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Debug

## Debug gRPC server

### Run gRPC server (CLI)

```bash
go run main.go serve
```

## Run gRPC server (VSCode)

As an alternative to the previous step, you can run the gRPC server in debug mode from VSCode. Use `Debug Launch` configuration. You can use breakpoints and step through the code.

### Run sync command

Make sure source configuration in `debug/debug.yml` corresponds your SharePoint environment.

Run the sync:

```bash
cloudquery sync debug/debug.yml
```

## Debug with plugin build

See more: [debug/README.md](debug/README.md)
104 changes: 104 additions & 0 deletions debug/debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
kind: source
spec:
name: "sharepoint"
registry: "grpc"
path: "localhost:7777"
version: "v1.0.0"
tables: ["*"]
spec:
auth:
strategy: "ondemand"
creds:
siteUrl: "https://spnode.sharepoint.com/sites/CloudQuery-sample"
lists:
_catalogs/users:
select:
- Title->name
- UserName
- FirstName
- LastName
- JobTitle
- Department
- EMail
- IsSiteAdmin
- Deleted
filter: "UserName ne null"
alias: "user"
Shared Documents:
select:
- FileLeafRef
- FileRef
- FileDirRef
- Author/Title
- File/Length
expand:
- Author
- File
alias: "document"
Lists/Managers:
select:
- Title
alias: "manager"
Lists/Customers:
select:
- Title
- RoutingNumber
- Region
- Revenue
- ManagerId
alias: "customer"
Lists/Orders:
select:
- Title
- CustomerId
- OrderNumber
- OrderDate
- Total
alias: "order"
content_types:
Task:
select:
- Title
- AssignedTo/Title
- TaskDueDate
- TaskStatus
- PercentComplete
expand:
- AssignedTo
alias: "task"
mmd:
8ed8c9ea-7052-4c1d-a4d7-b9c10bffea6f:
alias: "department"
profiles:
enabled: true
search:
media:
query_text: "media"
select_properties:
- Size
- Title
- ContentTypeId
- IsDocument
- FileType
- DocId
- SPWebUrl
- SiteId
- WebId
- ListId
profiles:
query_text: "*"
source_id: "b09a7990-05ea-4af9-81ef-edfab16c4e31"
trim_duplicates: false
select_properties:
- Title -> name
destinations:
- "sqlite"
---
kind: destination
spec:
name: sqlite
path: cloudquery/sqlite
registry: cloudquery
version: "v2.4.15"
spec:
connection_string: ./debug/sp.db

0 comments on commit b366868

Please sign in to comment.