{"modulePath":"github.com/devmiahub/langchaingo","version":"v0.1.15","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cloudsqlutil\n\n## Types\n\n```go\ntype Column struct {\n\tName     string\n\tDataType string\n\tNullable bool\n}\n```\n\n```go\ntype EmailRetriever func(ctx context.Context) (string, error)\n```\n\n```go\ntype InitChatHistoryTableOptions struct {\n\t// contains filtered or unexported fields\n}\n```\nOption type for defining options.\n\n```go\ntype Option func(p *engineConfig)\n```\nOption is a function type that can be used to modify the Engine.\n\n```go\nfunc WithCloudSQLInstance(projectID, region, instance string) Option\n```\nWithCloudSQLInstance sets the project, region, and instance fields.\n\n```go\nfunc WithDatabase(database string) Option\n```\nWithDatabase sets the Database field.\n\n```go\nfunc WithIAMAccountEmail(email string) Option\n```\nWithIAMAccountEmail sets the IAMAccountEmail field.\n\n```go\nfunc WithIPType(ipType string) Option\n```\nWithIPType sets the IpType field.\n\n```go\nfunc WithPassword(password string) Option\n```\nWithPassword sets the Password field.\n\n```go\nfunc WithPool(pool *pgxpool.Pool) Option\n```\nWithPool sets the Port field.\n\n```go\nfunc WithUser(user string) Option\n```\nWithUser sets the User field.\n\n```go\ntype OptionInitChatHistoryTable func(*InitChatHistoryTableOptions)\n```\nOption function type.\n\n```go\nfunc WithSchemaName(schemaName string) OptionInitChatHistoryTable\n```\nWithSchemaName sets a custom schema name.\n\n```go\ntype PostgresEngine struct {\n\tPool *pgxpool.Pool\n}\n```\n\n```go\nfunc NewPostgresEngine(ctx context.Context, opts ...Option) (PostgresEngine, error)\n```\nNewPostgresEngine creates a new PostgresEngine.\n\n```go\nfunc (p *PostgresEngine) Close()\n```\nClose closes the pool connection.\n\n```go\nfunc (p *PostgresEngine) InitChatHistoryTable(ctx context.Context, tableName string, opts ...OptionInitChatHistoryTable) error\n```\ninitChatHistoryTable creates a table to store chat history.\n\n```go\nfunc (p *PostgresEngine) InitVectorstoreTable(ctx context.Context, opts VectorstoreTableOptions) error\n```\ninitVectorstoreTable creates a table for saving of vectors to be used with PostgresVectorStore.\n\n```go\ntype VectorstoreTableOptions struct {\n\tTableName          string\n\tVectorSize         int\n\tSchemaName         string\n\tContentColumnName  string\n\tEmbeddingColumn    string\n\tMetadataJSONColumn string\n\tIDColumn           Column\n\tMetadataColumns    []Column\n\tOverwriteExisting  bool\n\tStoreMetadata      bool\n}\n```\nVectorstoreTableOptions is used with the InitVectorstoreTable to use the required and default fields.\n\n","path":"github.com/devmiahub/langchaingo/util/cloudsqlutil","name":"cloudsqlutil","synopsis":"","isRedistributable":true}
