Store dataframes in structure and storing multiple database connection in connection pool

Sandy45
Fri, 04 Aug 2023 01:41:25 +0000
General Usage

Q1 - I am working with multiple dataframes and trying to create structure with dataframes in it so that they can be accessed easily. I’ve created struct like below and when I try to assign the data to it I got an error “setfield! fields of Types should not be changed” despite of defining mutable struct. I’ve also tried using macro @set from Setfield package.

mutable struct all_dataframes1
       map_df::DataFrame
       code_df::DataFrame
       end

s = @set all_dataframes.map_df = df

ERROR: UndefRefError: access to undefined reference
Stacktrace:
  [1] getproperty
    @ .\Base.jl:37 [inlined]
  [2] _broadcast_getindex_evalf


Q2 - I am trying to store multiple database connections (eg. MYSQL and PostgreSQL) in connection pool so that I can access at any point in my code. I've seen there is connectionpool.jl that has been created for Redis but haven't found in packages registry.

4 posts - 3 participants