src-d / gitbase

SQL interface to git repositories, written in Go. https://docs.sourced.tech/gitbase
Apache License 2.0
2.07k stars 123 forks source link

Import path extraction query example is no longer valid #933

Closed smola closed 5 years ago

smola commented 5 years ago

This is no longer valid with latest bblfsh version:

https://docs.sourced.tech/gitbase/using-gitbase/examples#extract-all-import-paths-for-every-go-file-on-head-reference

uast_extract(uast(blob_content, LANGUAGE(file_path), '//uast:Import/Path'), "Value") AS imports

//uast:Import/Path is still valid for Go, but the UAST_EXTRACT(..., "Value") part no longer applies (thanks @bzz for helping me understanding this)

More info:

dennwc commented 5 years ago

As a note, we also added the helper to properly extract import paths for any language. We will ensure this function works even if UAST structure changes.

It may be a good idea to add this helper as a UDF for Gitbase.

erizocosmico commented 5 years ago

Will be taken care of as part of https://github.com/src-d/gitbase/issues/936

erizocosmico commented 5 years ago

It was deleted until we implement something more convenient, such as the helpers pointed out by Dennis.

erizocosmico commented 5 years ago

Shall we close the issue or keep it open until a replacement for getting imports is implemented?

ajnavarro commented 5 years ago

Maybe we can close this and open another to implement special bblfsh functions as UDFs, like that one that is extracting imports in the same way in any lang.

erizocosmico commented 5 years ago

Closing in favor of #943