mongodb

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package mongodb provides functionality for extracting database schema information from MongoDB databases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source represents a MongoDB database source for schema extraction.

func NewSource

func NewSource(connStr string) (*Source, error)

NewSource creates a new MongoDB source from a connection string.

func NewSourceFromClient

func NewSourceFromClient(client *mongo.Client) *Source

NewSourceFromClient creates a new MongoDB source from an existing client. This is useful when you want to reuse an existing MongoDB client for schema extraction purposes.

func (*Source) Close

func (s *Source) Close() error

Close closes the MongoDB client if it was created by NewSource. If the client was provided externally (via NewSourceFromClient), this is a no-op.

func (*Source) ExtractSchema

func (s *Source) ExtractSchema(ctx context.Context) (schema dberd.Schema, err error)

ExtractSchema extracts the complete database schema including collections.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL