% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Storage.R
\name{set_postgres_storage}
\alias{set_postgres_storage}
\title{Set PostgreSQL storage}
\usage{
set_postgres_storage(
  gitstats,
  host = NULL,
  port = NULL,
  dbname = NULL,
  user = NULL,
  password = NULL,
  schema = "git_stats",
  ...
)
}
\arguments{
\item{gitstats}{A GitStats object.}

\item{host}{A character, database host.}

\item{port}{An integer, database port.}

\item{dbname}{A character, database name.}

\item{user}{A character, database user.}

\item{password}{A character, database password.}

\item{schema}{A character, database schema (default \code{"git_stats"}).}

\item{...}{Additional arguments passed to
\code{DBI::dbConnect(RPostgres::Postgres(), ...)}.}
}
\value{
A \code{GitStats} object (invisibly).
}
\description{
Persist GitStats data in a PostgreSQL database. R classes,
custom attributes, and column types are preserved via a \verb{_metadata} table.
Requires \code{DBI}, \code{RPostgres}, and \code{jsonlite} packages.
}
\examples{
\dontrun{
  my_gitstats <- create_gitstats() |>
    set_postgres_storage(
      dbname = "my_database",
      host = "localhost",
      user = "postgres",
      password = "secret"
    )
}
}
