MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / sql

Method sql

openlibrary/utils/schema.py:345–355  ·  view source on GitHub ↗
(self, engine)

Source from the content-addressed store, hash-verified

343 self.name = options.get("name")
344
345 def sql(self, engine):
346 adapter = get_adapter(engine)
347
348 if self.unique:
349 s = "create unique index "
350 else:
351 s = "create index "
352
353 s += adapter.index_name(self.table, self.columns)
354 s += " on {}({});".format(self.table, ", ".join(self.columns))
355 return s
356
357
358def _test():

Callers

nothing calls this directly

Calls 3

get_adapterFunction · 0.85
index_nameMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected