vitonsky

joined 2 years ago
[–] vitonsky@programming.dev 2 points 4 months ago* (last edited 4 months ago)

When you use query builder, you write a raw SQL code.

The benifit is you can insert user input right in string, and your query remain secure against injections. Additionally, a Nano Queries let you compose queries, and extend it, so you may build complex queries simply.

Let's say you develop a site to search something by its features, for example a movies. Your SQL query may easy takes 100-500 lines. Some part of this query will be a basic, some will be optional depends on provided filters.

With a query builder you may conditionally extend your query like that

if (userInput.rating > 0) {
  filter.and(sql`rating >= ${userInput.rating}`);
}

That's all Query Builder does. It let you avoid to write code like that

const values = [];
const getPlaceholder = (value) => {
  values.push(value);
  return `$${values.length}`;
};

const where = [];
if (year) {
  where.push(`release_year = ${getPlaceholder(year)}`);
}
if (rating) {
  where.push(`rating >= ${getPlaceholder(rating)}`);
}

db.query(
  `SELECT title FROM movies ${where.length ? 'WHERE ' + where.join(' AND ') : ''} LIMIT 100`,
  values,
);
 

Ordinality let you manage any changes in your system via declarative actions, and a storage that remember applied actions.

Ordinality may be used to migrate scheme in your postgres database, to migrate from a JSON file to a database and back, to copy files from SSD to a S3, etc.

 

Ordinality may be used to migrate scheme in your postgres database, to migrate from a JSON file to a database and back, to copy files from SSD to a S3, etc.

Ordinality let you manage any changes in your system via declarative actions, and a storage that remember applied actions.

[–] vitonsky@programming.dev 0 points 1 year ago

Now you may send link on this post to your manager, to justify a proper decision

[–] vitonsky@programming.dev 0 points 2 years ago (1 children)

You can make a language request in a issues of repository https://github.com/mozilla/firefox-translations-models/

You're right, resources are limited and a new languages appears not so fast as we wants. Maybe Chinese developers will collaborate and release their own models for a Bergamot. Work with community are important to achieve the goal when we want to unify translation.

If you really needs to be private for now, you can try to deploy your own offline translation server locally (e.g. with a https://github.com/LibreTranslate/LibreTranslate) and use this translator with Linguist as a custom translator.

view more: next ›