@@ -109,6 +109,7 @@ func NewStorage(ctx context.Context, cfg *config.Config, poolSize int) (_ *Stora
109109 s .x .SetTableMapper (newMapper (cfg .Table , "entry" ))
110110
111111 s .x .SetLogLevel (log .LOG_DEBUG )
112+ s .x .ShowSQL (true )
112113
113114 tableParams := map [string ]string {
114115 "AUTO_PARTITIONING_BY_SIZE" : "ENABLED" ,
@@ -134,7 +135,7 @@ func (s *Storage) Read(ctx context.Context, id generator.RowID) (row generator.R
134135 row .ID = id
135136
136137 err = retry .Do (ydb .WithTxControl (ctx , readTx ), s .x .DB ().DB ,
137- func (ctx context.Context , cc * sql.Conn ) (err error ) {
138+ func (ctx context.Context , _ * sql.Conn ) (err error ) {
138139 has , err := s .x .Context (ctx ).Get (& row )
139140 if err != nil {
140141 return fmt .Errorf ("get entry error: %w" , err )
@@ -173,7 +174,7 @@ func (s *Storage) Write(ctx context.Context, row generator.Row) (attempts int, e
173174 defer cancel ()
174175
175176 err = retry .Do (ydb .WithTxControl (ctx , writeTx ), s .x .DB ().DB ,
176- func (ctx context.Context , cc * sql.Conn ) (err error ) {
177+ func (ctx context.Context , _ * sql.Conn ) (err error ) {
177178 if err = ctx .Err (); err != nil {
178179 return err
179180 }
@@ -208,7 +209,9 @@ func (s *Storage) createTable(ctx context.Context) error {
208209 ctx , cancel := context .WithTimeout (ctx , time .Duration (s .cfg .WriteTimeout )* time .Millisecond )
209210 defer cancel ()
210211
211- return s .x .Context (ctx ).CreateTable (generator.Row {})
212+ return retry .Do (ctx , s .x .DB ().DB , func (ctx context.Context , _ * sql.Conn ) error {
213+ return s .x .Context (ctx ).CreateTable (generator.Row {})
214+ })
212215}
213216
214217func (s * Storage ) dropTable (ctx context.Context ) error {
@@ -219,7 +222,9 @@ func (s *Storage) dropTable(ctx context.Context) error {
219222 ctx , cancel := context .WithTimeout (ctx , time .Duration (s .cfg .WriteTimeout )* time .Millisecond )
220223 defer cancel ()
221224
222- return s .x .Context (ctx ).DropTable (generator.Row {})
225+ return retry .Do (ctx , s .x .DB ().DB , func (ctx context.Context , _ * sql.Conn ) error {
226+ return s .x .Context (ctx ).DropTable (generator.Row {})
227+ })
223228}
224229
225230func (s * Storage ) close (ctx context.Context ) error {
0 commit comments