Store Module

The Store module provides functions for creating, retrieving, and managing GEOID sets in the database with versioning support.

Creating GEOID Sets

Functions for creating new GEOID sets and versions:

GeoIDs.Store.create_geoid_setFunction
create_geoid_set(set_name::String, description::String="", geoids::Vector{String}=String[])

Create a new GEOID set with optional initial members.

source
GeoIDs.Store.create_geoid_set_versionFunction
create_geoid_set_version(set_name::String, geoids::Vector{String}, 
                        change_description::String="", base_version::Int=0,
                        description::String="") -> Int

Create a new version of an existing GEOID set or create a new set (version 1) if it doesn't exist.

Arguments

  • set_name::String: Name of the set
  • geoids::Vector{String}: GEOIDs for the new version
  • change_description::String: Description of what changed in this version
  • base_version::Int: Base version to create from (0 means latest version or new set)
  • description::String: Description for the set (only used for new sets)

Returns

  • Int: The new version number
source

Retrieving GEOID Sets

Functions for retrieving GEOID sets and their versions:

GeoIDs.Store.get_geoid_setFunction
get_geoid_set(set_name::String) -> Vector{String}

Get the current version of a GEOID set.

Arguments

  • set_name::String: Name of the set

Returns

  • Vector{String}: GEOIDs in the current version of the set
source
GeoIDs.Store.get_geoid_set_versionFunction
get_geoid_set_version(set_name::String, version::Int=0) -> Vector{String}

Get GEOIDs for a specific version of a set. Use version=0 for current version.

Arguments

  • set_name::String: Name of the set
  • version::Int: Version to retrieve (0 means current version)

Returns

  • Vector{String}: GEOIDs in the specified version
source
GeoIDs.Store.list_geoid_set_versionsFunction
list_geoid_set_versions(set_name::String) -> DataFrame

List all versions of a GEOID set with change information.

Arguments

  • set_name::String: Name of the set

Returns

  • DataFrame: DataFrame with version info
source

Modifying GEOID Sets

Functions for adding to or removing from GEOID sets:

GeoIDs.Store.add_to_geoid_setFunction
add_to_geoid_set(set_name::String, geoids::Vector{String}, change_description::String="Added GEOIDs") -> Int

Add GEOIDs to an existing set by creating a new version.

Arguments

  • set_name::String: Name of the set
  • geoids::Vector{String}: GEOIDs to add
  • change_description::String: Description of the change

Returns

  • Int: The new version number
source
GeoIDs.Store.remove_from_geoid_setFunction
remove_from_geoid_set(set_name::String, geoids::Vector{String}, change_description::String="Removed GEOIDs") -> Int

Remove GEOIDs from an existing set by creating a new version.

Arguments

  • set_name::String: Name of the set
  • geoids::Vector{String}: GEOIDs to remove
  • change_description::String: Description of the change

Returns

  • Int: The new version number
source

Version Management

Functions for managing and comparing versions:

GeoIDs.Store.rollback_geoid_setFunction
rollback_geoid_set(set_name::String, version::Int) -> Int

Rollback a GEOID set to a previous version by creating a new version.

Arguments

  • set_name::String: Name of the set
  • version::Int: Version to rollback to

Returns

  • Int: The new version number (after rollback)
source
GeoIDs.Store.compare_geoid_set_versionsFunction
compare_geoid_set_versions(set_name::String, version1::Int, version2::Int) -> Dict

Compare two versions of a GEOID set and return differences.

Arguments

  • set_name::String: Name of the set
  • version1::Int: First version to compare
  • version2::Int: Second version to compare

Returns

  • Dict: Dictionary with 'added', 'removed', and 'common' GEOIDs
source

Deleting GEOID Sets

Module Index