MCPcopy Create free account
hub / github.com/piccolo-orm/piccolo / insert_rows

Method insert_rows

tests/base.py:347–407  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

345 );""")
346
347 def insert_rows(self):
348 assert ENGINE is not None
349
350 if ENGINE.engine_type == "cockroach":
351 id = self.run_sync("""
352 INSERT INTO manager (
353 name
354 ) VALUES (
355 'Guido'
356 ),(
357 'Graydon'
358 ),(
359 'Mads'
360 ) RETURNING id;""")
361 self.run_sync(f"""
362 INSERT INTO band (
363 name,
364 manager,
365 popularity
366 ) VALUES (
367 'Pythonistas',
368 {id[0]["id"]},
369 1000
370 ),(
371 'Rustaceans',
372 {id[1]["id"]},
373 2000
374 ),(
375 'CSharps',
376 {id[2]["id"]},
377 10
378 );""")
379 else:
380 self.run_sync("""
381 INSERT INTO manager (
382 name
383 ) VALUES (
384 'Guido'
385 ),(
386 'Graydon'
387 ),(
388 'Mads'
389 );""")
390 self.run_sync("""
391 INSERT INTO band (
392 name,
393 manager,
394 popularity
395 ) VALUES (
396 'Pythonistas',
397 1,
398 1000
399 ),(
400 'Rustaceans',
401 2,
402 2000
403 ),(
404 'CSharps',

Callers

nothing calls this directly

Calls 1

run_syncMethod · 0.95

Tested by

no test coverage detected