GithubHelp home page GithubHelp logo

Nulls Last about periscope HOT 4 CLOSED

krazyjakee avatar krazyjakee commented on May 28, 2024
Nulls Last

from periscope.

Comments (4)

laserlemon avatar laserlemon commented on May 28, 2024

Hi @krazyjakee! That's a question for your specific database rather than for Periscope. For instance, here's the documentation for PostgreSQL: https://www.postgresql.org/docs/9.5/static/queries-order.html

SELECT select_list FROM table_expression ORDER BY sort_expression1 ASC NULLS LAST

Googling around should give you what you want! In a Rails context, you may want to use Arel to build and add the NULLS FIRST/LAST clause to your query ordering. Good luck!

from periscope.

krazyjakee avatar krazyjakee commented on May 28, 2024

I am throwing the query parameters into periscopes black box which also handles sorting.

.periscope(request.query_parameters)

Are there no extra options I can pass to ask periscope to tweak the ordering?

EDIT: Update the model. Of course, got it. Thank you for taking the time.

from periscope.

laserlemon avatar laserlemon commented on May 28, 2024

Periscope is only an interface to whatever scopes your model already defines. How your models' scopes handle ordering is a question I can't answer. Periscope will happily use whatever scope you define. If you want to give an example of parameters you're passing in, maybe I can help point you in the right direction.

from periscope.

krazyjakee avatar krazyjakee commented on May 28, 2024

You're super kind, thank you. It suddenly hit me as it should have hours ago 👯

Still getting used to rails, thank you again.

from periscope.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.