   alias FunWithFlags.Store.Persistent.Ecto.Record
   alias FunWithFlags.Store.Serializer.Ecto, as: Serializer
 
+  import FunWithFlags.Config, only: [ecto_repo: 0]
   import Ecto.Query
 
   require Logger
 
-  @repo Config.ecto_repo()
   @mysql_lock_timeout_s 3
   @table_name Config.ecto_table_name()
 



  defp db_type do
    case @repo.__adapter__() do
      Ecto.Adapters.Postgres -> :postgres
      Ecto.Adapters.MySQL -> :mysql # legacy, Mariaex
      Ecto.Adapters.MyXQL -> :mysql # new in ecto_sql 3.1


  defp mysql_lock! do
    result = Ecto.Adapters.SQL.query!(
      ecto_repo(),
      "SELECT GET_LOCK('fun_with_flags_percentage_gate_upsert', #{@mysql_lock_timeout_s})"
    )

