home / github / issue_comments

Menu
  • GraphQL API

issue_comments: 466695672

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/sqlite-utils/issues/11#issuecomment-466695672 https://api.github.com/repos/simonw/sqlite-utils/issues/11 466695672 MDEyOklzc3VlQ29tbWVudDQ2NjY5NTY3Mg== 9599 2019-02-23T21:10:23Z 2019-02-23T21:10:23Z OWNER Rough sketch: ``` +try: + import numpy +except ImportError: + numpy = None + Column = namedtuple( "Column", ("cid", "name", "type", "notnull", "default_value", "is_pk") ) @@ -70,6 +79,22 @@ class Database: datetime.time: "TEXT", None.__class__: "TEXT", } + # If numpy is available, add more types + if numpy: + col_type_mapping.update({ + numpy.int8: "INTEGER", + numpy.int16: "INTEGER", + numpy.int32: "INTEGER", + numpy.int64: "INTEGER", + numpy.uint8: "INTEGER", + numpy.uint16: "INTEGER", + numpy.uint32: "INTEGER", + numpy.uint64: "INTEGER", + numpy.float16: "FLOAT", + numpy.float32: "FLOAT", + numpy.float64: "FLOAT", + numpy.float128: "FLOAT", + }) ``` {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} 413740684  
Powered by Datasette · Queries took 1.137ms