django-sql-explorer | Easily share data across your company via SQL queries | SQL Database library

 by   groveco Python Version: 4.0b4 License: MIT

kandi X-RAY | django-sql-explorer Summary

kandi X-RAY | django-sql-explorer Summary

django-sql-explorer is a Python library typically used in Database, SQL Database, PostgresSQL applications. django-sql-explorer has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can install using 'pip install django-sql-explorer' or download it from GitHub, PyPI.

Easily share data across your company via SQL queries. From Grove Collab.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              django-sql-explorer has a medium active ecosystem.
              It has 2113 star(s) with 338 fork(s). There are 75 watchers for this library.
              There were 4 major release(s) in the last 12 months.
              There are 14 open issues and 251 have been closed. On average issues are closed in 541 days. There are 7 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of django-sql-explorer is 4.0b4

            kandi-Quality Quality

              django-sql-explorer has 0 bugs and 0 code smells.

            kandi-Security Security

              django-sql-explorer has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              django-sql-explorer code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              django-sql-explorer is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              django-sql-explorer releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              It has 4109 lines of code, 295 functions and 75 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed django-sql-explorer and discovered the below as its top functions. This is intended to give you an instant insight into django-sql-explorer implemented functionality, and help decide if they suit your requirements.
            • Handles the POST request
            • Generate tokens from a list
            • Render an explorer page
            • Returns a boolean indicating if the sql matches the whitelist
            • Render a query
            • Extract parameters from text
            • Generate context variables
            • Return a list of available query parameters
            • Snapshot a query
            • Get output
            • Uploads data to S3
            • Get the xlsx output
            • Format the title
            • Adds context data to context
            • Overrides dispatch
            • Called once
            • Returns a queryset of QueryLog
            • Build context data
            • Check if the user has permission to view
            • Returns a queryset of QueryLogs
            • Create a query
            • Return a list of Snapshot objects
            • Get the version string
            • Handle GET request
            • View of a schema
            • Format a SQL statement
            Get all kandi verified functions for this library.

            django-sql-explorer Key Features

            No Key Features are available at this moment for django-sql-explorer.

            django-sql-explorer Examples and Code Snippets

            No Code Snippets are available at this moment for django-sql-explorer.

            Community Discussions

            QUESTION

            Using Django SQL Explorer how do I correctly set default dates for paramters with PostgreSQL backend?
            Asked 2019-Nov-08 at 23:10

            Our Django application just migrated from MySQL to PostgreSQL, and we are in the process of updating our user queries to use the correct syntax. These queries are stored/executed via Django-SQL-Explorer.

            I have a query that for simplicity's sake looks like this:

            SELECT * FROM table t WHERE t.scheduled_start_date BETWEEN $$from_date$$ AND $$to_date$$

            The query above works, but I would like to set defaults for today & today+30 respectively.

            I've tried the following WHERE clauses to no avail:

            Works with user entered date, default throws syntax error

            WHERE t.scheduled_start_date BETWEEN date('$$from_date:CURRENT_DATE$$') AND date('$$to_date:CURRENT_DATE + INTERVAL \'30 DAY\'$$')

            Error using defaults:
            syntax error at or near "30" LINE 28: ...urrent_date') AND date('current_date + interval \'30 day\'') ^

            Defaults work correctly, but user entered dates do not:

            WHERE t.scheduled_start_date BETWEEN date($$from_date:CURRENT_DATE$$) AND date($$to_date:CURRENT_DATE + INTERVAL '30 DAY'$$)

            Error with user dates:
            function date(integer) does not exist LINE 28: WHERE t.scheduled_start_date BETWEEN date(2019-09-30) AND da... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.

            The message about casting makes sense to me since the user enters in string data, however I can't seem to get the syntax right that casts to DATE but only when the default is overridden.

            Any suggestions would be helpful. Thanks!

            ...

            ANSWER

            Answered 2019-Nov-08 at 23:10

            Your input is a string value, current_date is a function call. The former needs quotes whereas the latter does not. Therefore your client side substitution will not work. You can move the default logic into the SQL statement using the COALESCE() function doc.

            In case the client sends NULL values for an empty user input this would result in the following where clause:

            Source https://stackoverflow.com/questions/58758125

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install django-sql-explorer

            You can install using 'pip install django-sql-explorer' or download it from GitHub, PyPI.
            You can use django-sql-explorer like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install django-sql-explorer

          • CLONE
          • HTTPS

            https://github.com/groveco/django-sql-explorer.git

          • CLI

            gh repo clone groveco/django-sql-explorer

          • sshUrl

            git@github.com:groveco/django-sql-explorer.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link